mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: disable overscroll on pinch-to-zoom
This commit is contained in:
parent
b5bf346229
commit
213134bbca
1 changed files with 14 additions and 11 deletions
|
@ -4270,17 +4270,20 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
const initialScale = gesture.initialScale;
|
const initialScale = gesture.initialScale;
|
||||||
if (initialScale) {
|
if (initialScale) {
|
||||||
this.setState((state) =>
|
this.setState((state) =>
|
||||||
constrainScrollState({
|
constrainScrollState(
|
||||||
...state,
|
{
|
||||||
...getStateForZoom(
|
...state,
|
||||||
{
|
...getStateForZoom(
|
||||||
viewportX: this.lastViewportPosition.x,
|
{
|
||||||
viewportY: this.lastViewportPosition.y,
|
viewportX: this.lastViewportPosition.x,
|
||||||
nextZoom: getNormalizedZoom(initialScale * event.scale),
|
viewportY: this.lastViewportPosition.y,
|
||||||
},
|
nextZoom: getNormalizedZoom(initialScale * event.scale),
|
||||||
state,
|
},
|
||||||
),
|
state,
|
||||||
}),
|
),
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue