Fix being unable to select imported objects

This commit is contained in:
Skyler Lehmkuhl 2025-01-06 16:27:28 -05:00
parent b1be503de9
commit 6d6b7a2154
1 changed files with 20 additions and 16 deletions

View File

@ -3332,6 +3332,7 @@ class GraphicsObject {
} }
if (mode == "select") { if (mode == "select") {
for (let item of context.selection) { for (let item of context.selection) {
if (!item) continue;
if (item.idx in this.currentFrame.keys) { if (item.idx in this.currentFrame.keys) {
ctx.save(); ctx.save();
ctx.strokeStyle = "#00ffff"; ctx.strokeStyle = "#00ffff";
@ -5663,24 +5664,27 @@ function outliner(object = undefined) {
outliner.collapsed[object.idx] = !outliner.collapsed[object.idx]; outliner.collapsed[object.idx] = !outliner.collapsed[object.idx];
} else { } else {
outliner.active = object; outliner.active = object;
context.objectStack = [] // Only do selection when this is pointing at the actual file
let parent = object; if (outliner.object==root) {
while (true) { context.objectStack = []
if (parent.parent) { let parent = object;
parent = parent.parent while (true) {
context.objectStack.unshift(parent) if (parent.parent) {
} else { parent = parent.parent
break context.objectStack.unshift(parent)
} else {
break
}
} }
if (context.objectStack.length==0) {
context.objectStack.push(root)
}
context.oldselection = context.selection
context.oldshapeselection = context.shapeselection
context.selection = [object]
context.shapeselection = []
actions.select.create()
} }
if (context.objectStack.length==0) {
context.objectStack.push(root)
}
context.oldselection = context.selection
context.oldshapeselection = context.shapeselection
context.selection = [object]
context.shapeselection = []
actions.select.create()
} }
updateOutliner(); // Re-render the outliner updateOutliner(); // Re-render the outliner
return; return;