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,
|
||||
isLoading: false,
|
||||
toastMessage: this.state.toastMessage || null,
|
||||
};
|
||||
if (initialData?.scrollToContent) {
|
||||
scene.appState = {
|
||||
|
@ -910,6 +911,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
} else {
|
||||
this.updateDOMRect(this.initializeScene);
|
||||
}
|
||||
this.checkIfBrowserZoomed();
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
|
@ -922,8 +924,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
clearTimeout(touchTimeout);
|
||||
touchTimeout = 0;
|
||||
}
|
||||
|
||||
private onResize = withBatchedUpdates(() => {
|
||||
private checkIfBrowserZoomed = () => {
|
||||
if (!this.device.isMobile) {
|
||||
const scrollBarWidth = 10;
|
||||
const widthRatio =
|
||||
|
@ -935,6 +936,9 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.clearToast();
|
||||
}
|
||||
}
|
||||
};
|
||||
private onResize = withBatchedUpdates(() => {
|
||||
this.checkIfBrowserZoomed();
|
||||
this.scene
|
||||
.getElementsIncludingDeleted()
|
||||
.forEach((element) => invalidateShapeForElement(element));
|
||||
|
|
Loading…
Add table
Reference in a new issue