mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
check if browser zoomed on mount
This commit is contained in:
parent
7ac79b7799
commit
a85b3147ce
1 changed files with 6 additions and 2 deletions
|
@ -772,6 +772,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
? { ...scene.appState.activeTool, type: "selection" }
|
? { ...scene.appState.activeTool, type: "selection" }
|
||||||
: scene.appState.activeTool,
|
: scene.appState.activeTool,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
toastMessage: this.state.toastMessage || null,
|
||||||
};
|
};
|
||||||
if (initialData?.scrollToContent) {
|
if (initialData?.scrollToContent) {
|
||||||
scene.appState = {
|
scene.appState = {
|
||||||
|
@ -910,6 +911,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
} else {
|
} else {
|
||||||
this.updateDOMRect(this.initializeScene);
|
this.updateDOMRect(this.initializeScene);
|
||||||
}
|
}
|
||||||
|
this.checkIfBrowserZoomed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
|
@ -922,8 +924,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
clearTimeout(touchTimeout);
|
clearTimeout(touchTimeout);
|
||||||
touchTimeout = 0;
|
touchTimeout = 0;
|
||||||
}
|
}
|
||||||
|
private checkIfBrowserZoomed = () => {
|
||||||
private onResize = withBatchedUpdates(() => {
|
|
||||||
if (!this.device.isMobile) {
|
if (!this.device.isMobile) {
|
||||||
const scrollBarWidth = 10;
|
const scrollBarWidth = 10;
|
||||||
const widthRatio =
|
const widthRatio =
|
||||||
|
@ -935,6 +936,9 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
this.clearToast();
|
this.clearToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
private onResize = withBatchedUpdates(() => {
|
||||||
|
this.checkIfBrowserZoomed();
|
||||||
this.scene
|
this.scene
|
||||||
.getElementsIncludingDeleted()
|
.getElementsIncludingDeleted()
|
||||||
.forEach((element) => invalidateShapeForElement(element));
|
.forEach((element) => invalidateShapeForElement(element));
|
||||||
|
|
Loading…
Add table
Reference in a new issue