fix restoring appState (#2182)

This commit is contained in:
David Luzar 2020-09-22 21:51:49 +02:00 committed by GitHub
parent b2822f3538
commit adb1ac5788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 74 additions and 49 deletions

View file

@ -3927,7 +3927,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
this.setState({ shouldCacheIgnoreZoom: false });
}, 300);
private getCanvasOffsets() {
private getCanvasOffsets(): Pick<AppState, "offsetTop" | "offsetLeft"> {
if (this.excalidrawRef?.current) {
const parentElement = this.excalidrawRef.current.parentElement;
const { left, top } = parentElement.getBoundingClientRect();