From b7a37c157bc694642e8198d1d5872354f14fcf13 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Thu, 30 Apr 2020 22:34:38 +0200 Subject: [PATCH] scroll horizontally on shift-scroll (#1519) --- src/components/App.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/App.tsx b/src/components/App.tsx index d1b3edf2..0857ca52 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -2567,6 +2567,14 @@ class App extends React.Component { return; } + // scroll horizontally when shift pressed + if (event.shiftKey) { + this.setState(({ zoom, scrollX }) => ({ + scrollX: normalizeScroll(scrollX - deltaY / zoom), + })); + return; + } + this.setState(({ zoom, scrollX, scrollY }) => ({ scrollX: normalizeScroll(scrollX - deltaX / zoom), scrollY: normalizeScroll(scrollY - deltaY / zoom),