mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-01-10 06:32:07 -05:00
Merge pull request #263 from towerofnix/shift-scroll
Add holding shift to force horizontal scrolling
This commit is contained in:
commit
35baf315a1
1 changed files with 6 additions and 0 deletions
|
@ -164,6 +164,12 @@ class PaperCanvas extends React.Component {
|
|||
new paper.Point(offsetX, offsetY)
|
||||
);
|
||||
zoomOnFixedPoint(-event.deltaY / 100, fixedPoint);
|
||||
} else if (event.shiftKey && event.deltaX === 0) {
|
||||
// Scroll horizontally (based on vertical scroll delta)
|
||||
// This is needed as for some browser/system combinations which do not set deltaX.
|
||||
// See #156.
|
||||
const dx = event.deltaY / paper.project.view.zoom;
|
||||
pan(dx, 0);
|
||||
} else {
|
||||
const dx = event.deltaX / paper.project.view.zoom;
|
||||
const dy = event.deltaY / paper.project.view.zoom;
|
||||
|
|
Loading…
Reference in a new issue