scroll the closest element to center (#1670)
Co-authored-by: Sanghyeon Lee <yongdamsh@gmail.com>
This commit is contained in:
@ -121,7 +121,10 @@ export const restore = (
|
||||
}, [] as ExcalidrawElement[]);
|
||||
|
||||
if (opts?.scrollToContent && savedState) {
|
||||
savedState = { ...savedState, ...calculateScrollCenter(elements) };
|
||||
savedState = {
|
||||
...savedState,
|
||||
...calculateScrollCenter(elements, savedState, null),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user