mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: Two finger panning is slow (#7849)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
ff0b4394b1
commit
be4e127f6c
2 changed files with 8 additions and 5 deletions
|
@ -5097,8 +5097,11 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
|
|
||||||
this.translateCanvas({
|
this.translateCanvas({
|
||||||
zoom: zoomState.zoom,
|
zoom: zoomState.zoom,
|
||||||
scrollX: zoomState.scrollX + deltaX / nextZoom,
|
// 2x multiplier is just a magic number that makes this work correctly
|
||||||
scrollY: zoomState.scrollY + deltaY / nextZoom,
|
// on touchscreen devices (note: if we get report that panning is slower/faster
|
||||||
|
// than actual movement, consider swapping with devicePixelRatio)
|
||||||
|
scrollX: zoomState.scrollX + 2 * (deltaX / nextZoom),
|
||||||
|
scrollY: zoomState.scrollY + 2 * (deltaY / nextZoom),
|
||||||
shouldCacheIgnoreZoom: true,
|
shouldCacheIgnoreZoom: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -10752,7 +10752,7 @@ exports[`regression tests > pinch-to-zoom works > [end of test] appState 1`] = `
|
||||||
"pendingImageElementId": null,
|
"pendingImageElementId": null,
|
||||||
"previousSelectedElementIds": {},
|
"previousSelectedElementIds": {},
|
||||||
"resizingElement": null,
|
"resizingElement": null,
|
||||||
"scrollX": -2.916666666666668,
|
"scrollX": -6.2500000000000036,
|
||||||
"scrollY": 0,
|
"scrollY": 0,
|
||||||
"scrolledOutside": false,
|
"scrolledOutside": false,
|
||||||
"selectedElementIds": {},
|
"selectedElementIds": {},
|
||||||
|
@ -13688,8 +13688,8 @@ exports[`regression tests > two-finger scroll works > [end of test] appState 1`]
|
||||||
"pendingImageElementId": null,
|
"pendingImageElementId": null,
|
||||||
"previousSelectedElementIds": {},
|
"previousSelectedElementIds": {},
|
||||||
"resizingElement": null,
|
"resizingElement": null,
|
||||||
"scrollX": 10,
|
"scrollX": 20,
|
||||||
"scrollY": -10,
|
"scrollY": -18.535533905932738,
|
||||||
"scrolledOutside": false,
|
"scrolledOutside": false,
|
||||||
"selectedElementIds": {},
|
"selectedElementIds": {},
|
||||||
"selectedElementsAreBeingDragged": false,
|
"selectedElementsAreBeingDragged": false,
|
||||||
|
|
Loading…
Add table
Reference in a new issue