Undo - compute dependent chars/frames at the end

This commit is contained in:
Jindra Petřík
2024-01-07 11:17:21 +01:00
parent 2fd0802ec1
commit 6e1f233d3d

View File

@@ -3474,7 +3474,8 @@ public class TagTreeContextMenu extends JPopupMenu {
private void undoTagActionPerformed(ActionEvent evt) {
AbstractTagTree tree = getTree();
List<TreeItem> sel = getSelectedItems();
List<TreeItem> sel = getSelectedItems();
Set<SWF> computeSWFs = new LinkedIdentityHashSet<>();
for (TreeItem item : sel) {
if (item instanceof Tag) {
@@ -3494,9 +3495,7 @@ public class TagTreeContextMenu extends JPopupMenu {
((Timelined) parentCharacter).resetTimeline();
}
}
swf.computeDependentCharacters();
swf.computeDependentFrames();
computeSWFs.add(swf);
tree.getFullModel().updateNode(item);
} catch (InterruptedException | IOException ex) {
logger.log(Level.SEVERE, null, ex);
@@ -3504,6 +3503,11 @@ public class TagTreeContextMenu extends JPopupMenu {
}
}
for (SWF swf : computeSWFs) {
swf.computeDependentCharacters();
swf.computeDependentFrames();
}
mainPanel.repaintTree();
}