mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: add scroll constraints to pinch-to-zoom in safari
This commit is contained in:
parent
82aa1cf19d
commit
4c62eef7da
1 changed files with 13 additions and 10 deletions
|
@ -4269,16 +4269,19 @@ class App extends React.Component<AppProps, AppState> {
|
|||
|
||||
const initialScale = gesture.initialScale;
|
||||
if (initialScale) {
|
||||
this.setState((state) => ({
|
||||
...getStateForZoom(
|
||||
{
|
||||
viewportX: this.lastViewportPosition.x,
|
||||
viewportY: this.lastViewportPosition.y,
|
||||
nextZoom: getNormalizedZoom(initialScale * event.scale),
|
||||
},
|
||||
state,
|
||||
),
|
||||
}));
|
||||
this.setState((state) =>
|
||||
constrainScrollState({
|
||||
...state,
|
||||
...getStateForZoom(
|
||||
{
|
||||
viewportX: this.lastViewportPosition.x,
|
||||
viewportY: this.lastViewportPosition.y,
|
||||
nextZoom: getNormalizedZoom(initialScale * event.scale),
|
||||
},
|
||||
state,
|
||||
),
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue