scroll horizontally on shift-scroll (#1519)

This commit is contained in:
David Luzar 2020-04-30 22:34:38 +02:00 committed by GitHub
parent 51f8146357
commit b7a37c157b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2567,6 +2567,14 @@ class App extends React.Component<any, AppState> {
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),