From 679c630a4da5e40e9f77f4d97ab64f12eb8aafb8 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 7 Oct 2021 17:01:19 +0200 Subject: [PATCH] :bug: Fix shift+wheel to horizontal scrolling in MacOS --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/viewport/actions.cljs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 345854941..f238908cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,6 +29,7 @@ - Fix problem inheriting attributes from SVG root when importing [Taiga #2124](https://tree.taiga.io/project/penpot/issue/2124) - Fix problem with lines and inside/outside stroke [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146) - Add stroke width in selection calculation [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146) +- Fix shift+wheel to horizontal scrolling in MacOS [#1217](https://github.com/penpot/penpot/issues/1217) ### :arrow_up: Deps updates ### :boom: Breaking changes diff --git a/frontend/src/app/main/ui/workspace/viewport/actions.cljs b/frontend/src/app/main/ui/workspace/viewport/actions.cljs index 8ee77b05a..b5427fb4e 100644 --- a/frontend/src/app/main/ui/workspace/viewport/actions.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/actions.cljs @@ -363,12 +363,14 @@ delta-y (-> (.-deltaY ^js event) (* unit) (/ zoom)) + delta-x (-> (.-deltaX ^js event) (* unit) (/ zoom))] (dom/prevent-default event) (dom/stop-propagation event) - (if (kbd/shift? event) + (if (and (not (cfg/check-platform? :macos)) ;; macos sends delta-x automaticaly, don't need to do it + (kbd/shift? event)) (st/emit! (dw/update-viewport-position {:x #(+ % delta-y)})) (st/emit! (dw/update-viewport-position {:x #(+ % delta-x) :y #(+ % delta-y)})))))))))