From d73889958f3076d12a008a95bd98659e30ae4dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 29 Oct 2022 15:14:23 +0200 Subject: [PATCH] Select position dialog - correct hilighting input tag --- .../decompiler/flash/gui/tagtree/TagTreeContextMenu.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java index 0b8f83316..4c6b1e590 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java @@ -1841,9 +1841,10 @@ public class TagTreeContextMenu extends JPopupMenu { Tag t = (Tag)items.get(0); TreePath path = tagTree.getSelectionPath(); Timelined timelined = null; - for (int i = path.getPathCount()-1; i >= 0; i--) { - if ((path.getPathComponent(i) instanceof DefineSpriteTag)||(path.getPathComponent(i) instanceof SWF)) { + for (int i = path.getPathCount() - 1 - 1 /*not last path component*/; i >= 0; i--) { + if ((path.getPathComponent(i) instanceof DefineSpriteTag) || (path.getPathComponent(i) instanceof SWF)) { timelined = (Timelined)path.getPathComponent(i); + break; } } if (timelined == null) { //should not happen