Select position dialog - correct hilighting input tag

This commit is contained in:
Jindra Petřík
2022-10-29 15:14:23 +02:00
parent 92ad9abe49
commit d73889958f
@@ -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