experiment with zooming
This commit is contained in:
parent
2e9c8851b3
commit
c84fad4436
@ -3917,9 +3917,21 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setState(newState);
|
||||||
|
if (this.state.scrollConstraints) {
|
||||||
|
// debounce to allow centering on user's cursor position before constraining
|
||||||
|
if (newState.zoom.value !== this.state.zoom.value) {
|
||||||
|
this.debounceConstrainScrollState(newState);
|
||||||
|
} else {
|
||||||
this.setState(constrainScrollState(newState));
|
this.setState(constrainScrollState(newState));
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private debounceConstrainScrollState = debounce((state: AppState) => {
|
||||||
|
this.setState(constrainScrollState(state, "rigid"));
|
||||||
|
}, 500);
|
||||||
|
|
||||||
private animateToConstrainedArea = (
|
private animateToConstrainedArea = (
|
||||||
fromValues: AnimateTranslateCanvasValues,
|
fromValues: AnimateTranslateCanvasValues,
|
||||||
toValues: AnimateTranslateCanvasValues,
|
toValues: AnimateTranslateCanvasValues,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user