From e71d86fc004b9a518604631696b618746612df21 Mon Sep 17 00:00:00 2001 From: Mikhail Rubanov Date: Sun, 31 Dec 2023 15:52:55 -0300 Subject: [PATCH] =?UTF-8?q?Update=20drag=E2=80=99n=E2=80=99drop=20scale=20?= =?UTF-8?q?during=20zoom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Features/Sources/CanvasAppKit/CanvasScrollView.swift | 4 +++- .../Features/Sources/CanvasAppKit/CanvasView.swift | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasScrollView.swift b/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasScrollView.swift index b9de38b2..9313286a 100644 --- a/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasScrollView.swift +++ b/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasScrollView.swift @@ -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 @@ -35,6 +37,6 @@ class CanvasScrollView: NSScrollView { private func updateHud(to magnification: CGFloat) { hud?.scale = 1 / magnification + dragNDropImageView?.scale = magnification } - } diff --git a/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasView.swift b/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasView.swift index eb82c658..ad8a73e6 100644 --- a/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasView.swift +++ b/VoiceOver Designer/Features/Sources/CanvasAppKit/CanvasView.swift @@ -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()