Skip to content

Commit

Permalink
Update drag’n’drop scale during zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
akaDuality committed Dec 31, 2023
1 parent bc81e0c commit e71d86f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import AppKit
import CommonUI
import Canvas

class CanvasScrollView: NSScrollView {

weak var hud: HUDLayer?
weak var dragNDropImageView: DragNDropImageView?

// Touch pad zooming is implemented at CanvasView

Expand Down Expand Up @@ -35,6 +37,6 @@ class CanvasScrollView: NSScrollView {

private func updateHud(to magnification: CGFloat) {
hud?.scale = 1 / magnification
dragNDropImageView?.scale = magnification
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class CanvasView: FlippedView {
scrollView.verticalScrollElasticity = .none
scrollView.horizontalScrollElasticity = .none
scrollView.hud = contentView.hud
scrollView.dragNDropImageView = dragnDropView
contentView.wantsLayer = true
contentView.addHUD()

Expand Down

0 comments on commit e71d86f

Please sign in to comment.