mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-18 23:10:16 +02:00
fix: always re-generate index of defined moved elements (#8040)
This commit is contained in:
@@ -133,27 +133,11 @@ const getMovedIndicesGroups = (
|
||||
let i = 0;
|
||||
|
||||
while (i < elements.length) {
|
||||
if (
|
||||
movedElements.has(elements[i].id) &&
|
||||
!isValidFractionalIndex(
|
||||
elements[i]?.index,
|
||||
elements[i - 1]?.index,
|
||||
elements[i + 1]?.index,
|
||||
)
|
||||
) {
|
||||
if (movedElements.has(elements[i].id)) {
|
||||
const indicesGroup = [i - 1, i]; // push the lower bound index as the first item
|
||||
|
||||
while (++i < elements.length) {
|
||||
if (
|
||||
!(
|
||||
movedElements.has(elements[i].id) &&
|
||||
!isValidFractionalIndex(
|
||||
elements[i]?.index,
|
||||
elements[i - 1]?.index,
|
||||
elements[i + 1]?.index,
|
||||
)
|
||||
)
|
||||
) {
|
||||
if (!movedElements.has(elements[i].id)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user