mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix fractional indices on adding new elements
This commit is contained in:
parent
5bc23d6dee
commit
7dfba985f9
4 changed files with 62 additions and 37 deletions
|
@ -235,9 +235,9 @@ const getTargetElementsMap = <T extends ExcalidrawElement>(
|
|||
) => {
|
||||
return indices.reduce((acc, index) => {
|
||||
const element = elements[index];
|
||||
acc[element.id] = element;
|
||||
acc.set(element.id, element);
|
||||
return acc;
|
||||
}, {} as Record<string, ExcalidrawElement>);
|
||||
}, new Map<string, ExcalidrawElement>());
|
||||
};
|
||||
|
||||
const shiftElementsByOne = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue