|
@@ -104,8 +104,11 @@ export const normalSelectItems = (
|
|
|
).map((id) => store.getItemById(id)!);
|
|
|
};
|
|
|
|
|
|
+export const useExcludeSelection = installGlobalVar(() => ref<string[]>([]))
|
|
|
+
|
|
|
export const useSelection = installGlobalVar(() => {
|
|
|
const layer = useHelperLayer();
|
|
|
+ const eSelection = useExcludeSelection()
|
|
|
const getChildren = useGetFormalChildren();
|
|
|
const box = new Rect({
|
|
|
stroke: themeColor,
|
|
@@ -128,6 +131,7 @@ export const useSelection = installGlobalVar(() => {
|
|
|
|
|
|
for (let i = 0; i < shapeBoxs.length; i++) {
|
|
|
if (
|
|
|
+
|
|
|
Util.haveIntersection(boxRect, shapeBoxs[i]) &&
|
|
|
!isRectContained(shapeBoxs[i], boxRect) &&
|
|
|
shapes[i] !== toRaw(transformer)
|
|
@@ -165,7 +169,7 @@ export const useSelection = installGlobalVar(() => {
|
|
|
};
|
|
|
|
|
|
const updateInitData = () => {
|
|
|
- shapes = getChildren();
|
|
|
+ shapes = getChildren().filter(shape => !eSelection.value.includes(shape.id()));
|
|
|
shapeBoxs = shapes.map((shape) => shape.getClientRect());
|
|
|
};
|
|
|
|
|
@@ -323,6 +327,7 @@ export const useSelectionRevise = () => {
|
|
|
const mParts = useMountParts();
|
|
|
const status = useMouseShapesStatus();
|
|
|
const store = useStore();
|
|
|
+ const eSelection = useExcludeSelection()
|
|
|
|
|
|
const { addShapes, delShapes, watchSelection } = useWatchSelection();
|
|
|
|
|
@@ -332,7 +337,7 @@ export const useSelectionRevise = () => {
|
|
|
const filterSelect = debounce(() => {
|
|
|
const children = getFormatChildren();
|
|
|
const mouseSelects = status.selects.filter((shape) =>
|
|
|
- children.includes(shape)
|
|
|
+ !eSelection.value.includes(shape.id()) && children.includes(shape)
|
|
|
);
|
|
|
status.selects = mouseSelects;
|
|
|
}, 16);
|
|
@@ -357,6 +362,7 @@ export const useSelectionRevise = () => {
|
|
|
status.selects = Array.from(
|
|
|
addShapes(new Set(initSelections), rectSelects)
|
|
|
);
|
|
|
+ // filterSelect()
|
|
|
}
|
|
|
}
|
|
|
);
|