stop zoom out at min %
This commit is contained in:
parent
c707f02b48
commit
15e58c0f69
@ -53,10 +53,15 @@ class ZoomTool extends PureComponent {
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const { zoomValue } = this.props;
|
||||
const { zoomValue, tldrawAPI } = this.props;
|
||||
const { stateZoomValue } = this.state;
|
||||
const isDifferent = zoomValue !== stateZoomValue;
|
||||
if (isDifferent) this.onChanger(zoomValue);
|
||||
if (isDifferent) {
|
||||
this.onChanger(zoomValue);
|
||||
if (tldrawAPI && zoomValue === 1 && tldrawAPI?.getPageState()?.camera?.zoom === 1) {
|
||||
tldrawAPI?.zoomToFit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onChanger(value) {
|
||||
|
Loading…
Reference in New Issue
Block a user