mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
scroll the closest element to center (#1670)
Co-authored-by: Sanghyeon Lee <yongdamsh@gmail.com>
This commit is contained in:
parent
0db7ac78c4
commit
fa359034c5
10 changed files with 100 additions and 15 deletions
|
@ -256,7 +256,9 @@ const LayerUI = ({
|
|||
<button
|
||||
className="scroll-back-to-content"
|
||||
onClick={() => {
|
||||
setAppState({ ...calculateScrollCenter(elements) });
|
||||
setAppState({
|
||||
...calculateScrollCenter(elements, appState, canvas),
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("buttons.scrollBackToContent")}
|
||||
|
@ -276,6 +278,7 @@ const LayerUI = ({
|
|||
onRoomCreate={onRoomCreate}
|
||||
onRoomDestroy={onRoomDestroy}
|
||||
onLockToggle={onLockToggle}
|
||||
canvas={canvas}
|
||||
/>
|
||||
) : (
|
||||
<div className="layer-ui__wrapper">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue