feat: disable animation on zooming
This commit is contained in:
parent
71918e57a8
commit
92be92071a
@ -7771,13 +7771,15 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
constrainedScrollX !== scrollX || constrainedScrollY !== scrollY;
|
constrainedScrollX !== scrollX || constrainedScrollY !== scrollY;
|
||||||
|
|
||||||
if (isStateChanged) {
|
if (isStateChanged) {
|
||||||
// Animate the scroll position when the cursor button is not down and scroll position is outside of the scroll constraints
|
// Animate the scroll position when the cursor button is not down and scroll position is outside of the scroll constraints.
|
||||||
|
// We don't want to animate the scroll position when the user is dragging the canvas or zooiming in/out.
|
||||||
if (
|
if (
|
||||||
(scrollX < scrollConstraints.x ||
|
(scrollX < scrollConstraints.x ||
|
||||||
scrollX + width > scrollConstraints.x + scrollConstraints.width ||
|
scrollX + width > scrollConstraints.x + scrollConstraints.width ||
|
||||||
scrollY < scrollConstraints.y ||
|
scrollY < scrollConstraints.y ||
|
||||||
scrollY + height > scrollConstraints.y + scrollConstraints.height) &&
|
scrollY + height > scrollConstraints.y + scrollConstraints.height) &&
|
||||||
cursorButton !== "down"
|
cursorButton !== "down" &&
|
||||||
|
zoom.value === prevState.zoom.value
|
||||||
) {
|
) {
|
||||||
this.setState({
|
this.setState({
|
||||||
scrollConstraints: { ...scrollConstraints, isAnimating: true },
|
scrollConstraints: { ...scrollConstraints, isAnimating: true },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user