mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
ensure restored elements are normalized before filter (#844)
This commit is contained in:
parent
a8a5733e50
commit
7e0e885417
1 changed files with 2 additions and 2 deletions
|
@ -343,7 +343,6 @@ function restore(
|
|||
opts?: { scrollToContent: boolean },
|
||||
): DataState {
|
||||
const elements = savedElements
|
||||
.filter(el => !isInvisiblySmallElement(el))
|
||||
.map(element => {
|
||||
let points: Point[] = [];
|
||||
if (element.type === "arrow") {
|
||||
|
@ -392,7 +391,8 @@ function restore(
|
|||
canvasOffsetX: element.canvasOffsetX || 0,
|
||||
canvasOffsetY: element.canvasOffsetY || 0,
|
||||
};
|
||||
});
|
||||
})
|
||||
.filter(el => !isInvisiblySmallElement(el));
|
||||
|
||||
if (opts?.scrollToContent && savedState) {
|
||||
savedState = { ...savedState, ...calculateScrollCenter(elements) };
|
||||
|
|
Loading…
Add table
Reference in a new issue