mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-02-18 13:29:36 +01:00
Fix zoom being set to NaN (#807)
* Fix zoom being set to NaN * recover zoom default value on restore if invalid Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
parent
d342cae2ae
commit
4e489bfb6d
@ -2185,7 +2185,7 @@ export class App extends React.Component<any, AppState> {
|
||||
document.documentElement.style.cursor = hitElement ? "move" : "";
|
||||
}}
|
||||
onPointerUp={this.removePointer}
|
||||
onPointerCancel={this.removePointer}
|
||||
onPointerLeave={this.removePointer}
|
||||
onDrop={e => {
|
||||
const file = e.dataTransfer.files[0];
|
||||
if (file?.type === "application/json") {
|
||||
|
@ -398,6 +398,10 @@ function restore(
|
||||
savedState = { ...savedState, ...calculateScrollCenter(elements) };
|
||||
}
|
||||
|
||||
if (savedState) {
|
||||
savedState.zoom = savedState.zoom || getDefaultAppState().zoom;
|
||||
}
|
||||
|
||||
return {
|
||||
elements: elements,
|
||||
appState: savedState,
|
||||
|
Loading…
Reference in New Issue
Block a user