fix selection
This commit is contained in:
parent
af934c6767
commit
ee899cea2d
1 changed files with 6 additions and 4 deletions
|
|
@ -271,16 +271,16 @@ export function useMouse(makeCheckPoint: () => void, insertMode: InsertMode, zoo
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
setSelection(oldSelection => {
|
setSelection(oldSelection => {
|
||||||
const newSelection = [];
|
const newSelection = [...oldSelection];
|
||||||
const common = [];
|
const common = [];
|
||||||
for (const shape of shapesInSelection) {
|
for (const shape of shapesInSelection) {
|
||||||
const uid = shape.dataset.uid;
|
const uid = shape.dataset.uid;
|
||||||
if (uid) {
|
if (uid) {
|
||||||
const parts = shape.dataset.parts?.split(' ') || [];
|
const parts = shape.dataset.parts?.split(' ') || [];
|
||||||
for (const part of parts) {
|
for (const part of parts) {
|
||||||
if (oldSelection.some(({uid: oldUid, part: oldPart}) =>
|
if (newSelection.some(({uid: oldUid, part: oldPart}) =>
|
||||||
uid === oldUid && part === oldPart)) {
|
uid === oldUid && part === oldPart)) {
|
||||||
common.push({uid, part});
|
// common.push({uid, part});
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -289,7 +289,9 @@ export function useMouse(makeCheckPoint: () => void, insertMode: InsertMode, zoo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return [...oldSelection, ...newSelection];
|
// console.log({newSelection, oldSelection, common});
|
||||||
|
// return [...oldSelection, ...newSelection];
|
||||||
|
return newSelection;xxxxxxxx
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue