fix: do not animate empty scene
This commit is contained in:
parent
d24a032dbb
commit
04e23e1d29
@ -2012,7 +2012,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
cursorButton,
|
cursorButton,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
// TODO: this could be replaced with memoization function like _.memoize()
|
|
||||||
const canUseMemoizedConstraints =
|
const canUseMemoizedConstraints =
|
||||||
isShallowEqual(scrollConstraints, prevState.scrollConstraints ?? {}) &&
|
isShallowEqual(scrollConstraints, prevState.scrollConstraints ?? {}) &&
|
||||||
isShallowEqual(
|
isShallowEqual(
|
||||||
@ -2058,7 +2057,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
shouldAnimate:
|
shouldAnimate:
|
||||||
isViewportOutsideOfConstrainedArea &&
|
isViewportOutsideOfConstrainedArea &&
|
||||||
this.state.cursorButton !== "down" &&
|
this.state.cursorButton !== "down" &&
|
||||||
prevState.zoom.value === this.state.zoom.value,
|
prevState.zoom.value === this.state.zoom.value &&
|
||||||
|
this.scene.getElementsIncludingDeleted().length > 0, // Do not animate when app is initialized but scene is empty - this would cause flickering
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user