mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
scroll horizontally on shift-scroll (#1519)
This commit is contained in:
parent
51f8146357
commit
b7a37c157b
1 changed files with 8 additions and 0 deletions
|
@ -2567,6 +2567,14 @@ class App extends React.Component<any, AppState> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// scroll horizontally when shift pressed
|
||||||
|
if (event.shiftKey) {
|
||||||
|
this.setState(({ zoom, scrollX }) => ({
|
||||||
|
scrollX: normalizeScroll(scrollX - deltaY / zoom),
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.setState(({ zoom, scrollX, scrollY }) => ({
|
this.setState(({ zoom, scrollX, scrollY }) => ({
|
||||||
scrollX: normalizeScroll(scrollX - deltaX / zoom),
|
scrollX: normalizeScroll(scrollX - deltaX / zoom),
|
||||||
scrollY: normalizeScroll(scrollY - deltaY / zoom),
|
scrollY: normalizeScroll(scrollY - deltaY / zoom),
|
||||||
|
|
Loading…
Add table
Reference in a new issue