fix: prevent viewport jumping when panning by mouse wheel

This commit is contained in:
Arnošt Pleskot 2023-09-03 16:54:04 +02:00
parent b0cdd00c2a
commit 806b1e9705
No known key found for this signature in database

View file

@ -2055,6 +2055,7 @@ class App extends React.Component<AppProps, AppState> {
shouldAnimate: shouldAnimate:
isViewportOutsideOfConstrainedArea && isViewportOutsideOfConstrainedArea &&
this.state.cursorButton !== "down" && this.state.cursorButton !== "down" &&
prevState.cursorButton === "down" &&
prevState.zoom.value === this.state.zoom.value && prevState.zoom.value === this.state.zoom.value &&
elementsIncludingDeleted.length > 0, // Do not animate when app is initialized but scene is empty - this would cause flickering elementsIncludingDeleted.length > 0, // Do not animate when app is initialized but scene is empty - this would cause flickering
}); });