Commit 783c755b authored by Christian Winter's avatar Christian Winter

brushselection working on instances

parent bbff5e2d
Pipeline #4766974 passed with stage
in 58 seconds
......@@ -184,8 +184,8 @@ class MouseHandler {
{
if (Selection.data.prefabInstances.includes(instance))
{
File.currentLayer.prefabDict.addInstance(instance);
Selection.data.removePrefabInstance(instance);
File.currentLayer.prefabDict.addInstance(instance);
Selection.data.removePrefabInstance(instance);
} else {
Selection.data.addPrefabInstance(instance);
File.currentLayer.prefabDict.removeInstance(instance);
......
......@@ -51,9 +51,23 @@
newSelPoints.push(line.end);
}
}
Selection.selectPoints(newSelPoints);
let prefabInstancesToChangeSelection = [];
// prefab instances
for (let kv of File.currentLayer.prefabDict.keyValuePairs) {
let prefab = kv[0];
let instances = kv[1];
for (let instance of instances)
if (instance.selectionHit())
prefabInstancesToChangeSelection.push(instance);
}
for (let instance of prefabInstancesToChangeSelection) {
Selection.data.addPrefabInstance(instance);
File.currentLayer.prefabDict.removeInstance(instance);
}
} else if (MouseHandler.MMBDown == true) {
let newUnselPoints = [];
......@@ -100,9 +114,20 @@
}
}
Selection.deselectPoints(newUnselPoints);
// prefab instances
let prefabInstancesToChangeSelection = [];
for (let instance of Selection.data.prefabInstances)
{
if (instance.selectionHit())
prefabInstancesToChangeSelection.push(instance);
}
for (let instance of prefabInstancesToChangeSelection) {
File.currentLayer.prefabDict.addInstance(instance);
Selection.data.removePrefabInstance(instance);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment