mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: update constraints on window resize
This commit is contained in:
parent
71f7960606
commit
f7e8056abe
1 changed files with 5 additions and 1 deletions
|
@ -7642,11 +7642,15 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
const { scrollX, scrollY, scrollConstraints, width, height, zoom } =
|
const { scrollX, scrollY, scrollConstraints, width, height, zoom } =
|
||||||
this.state;
|
this.state;
|
||||||
|
|
||||||
|
// Skip if scroll constraints are not defined or if the zoom level or viewport dimensions have not changed.
|
||||||
|
// Constrains and scene will update on change of viewport dimensions.
|
||||||
if (
|
if (
|
||||||
!scrollConstraints ||
|
!scrollConstraints ||
|
||||||
(this.state.zoom.value === prevState.zoom.value &&
|
(this.state.zoom.value === prevState.zoom.value &&
|
||||||
this.state.scrollX === prevState.scrollX &&
|
this.state.scrollX === prevState.scrollX &&
|
||||||
this.state.scrollY === prevState.scrollY)
|
this.state.scrollY === prevState.scrollY &&
|
||||||
|
this.state.width === prevState.width &&
|
||||||
|
this.state.height === prevState.height)
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue