From 3bbe38ec9cc75337ed3a6759c8c7100b073cddd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 20 Oct 2024 17:01:02 +0200 Subject: [PATCH] Easy UI: Add frame fix --- .../flash/easygui/TimelineBodyPanel.java | 72 ++++++------------- 1 file changed, 22 insertions(+), 50 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/easygui/TimelineBodyPanel.java b/src/com/jpexs/decompiler/flash/easygui/TimelineBodyPanel.java index 68f429340f..a37ada45cb 100644 --- a/src/com/jpexs/decompiler/flash/easygui/TimelineBodyPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/TimelineBodyPanel.java @@ -1019,8 +1019,8 @@ public void doOperation() { break; } } - } - + } + int lastFrame = timelined.getFrameCount() - 1; //Add removeTag to other layers for (int d = 1; d <= timeline.maxDepth; d++) { @@ -1061,17 +1061,14 @@ public void doOperation() { ds = timeline.getDepthState(f, nd); boolean empty = ds == null || ds.getCharacter() == null; if (!empty || somethingAfter) { - int moveFrameCount = nf - f; - if (moveFrameCount == 0) { - moveFrameCount = 1; - } - boolean frameAdded = false; + int moveFrameCount = somethingAfter ? 1 : nf - f; for (int mf = 0; mf < moveFrameCount; mf++) { int pos = timelined.indexOfTag(timeline.getFrame(f).showFrameTag); ReadOnlyTagList tags = timelined.getTags(); List lastFrameDepthTags = new ArrayList<>(); int f2 = f + 1; boolean endsWithRemove = false; + boolean removeOnly = true; for (int i = pos + 1; i < tags.size(); i++) { Tag t = tags.get(i); if (t instanceof PlaceObjectTypeTag) { @@ -1100,7 +1097,7 @@ public void doOperation() { i++; } - boolean removeOnly = true; + removeOnly = true; for (Tag lt : lastFrameDepthTags) { if (!(lt instanceof RemoveTag)) { removeOnly = false; @@ -1117,57 +1114,32 @@ public void doOperation() { } } - //Add beyond current total frameCount - if (onLastFrame) { - if ((!removeOnly && !lastFrameDepthTags.isEmpty()) || !endsWithRemove) { - //Add removeTag to other layers - for (int d = 1; d <= timeline.maxDepth; d++) { - if (d == nd) { - continue; - } - ds = timeline.getDepthState(f2, d); - if (ds != null && ds.getCharacter() != null) { - RemoveTag rt = new RemoveObject2Tag(timelined.getSwf()); - rt.setTimelined(timelined); - rt.setDepth(d); - timelined.addTag(i, rt); - i++; - } - } - - frameAdded = true; - ShowFrameTag sf = new ShowFrameTag(timelined.getSwf()); - sf.setTimelined(timelined); - timelined.addTag(sf); - i++; - timelined.setFrameCount(timelined.getFrameCount() + 1); - } - } lastFrameDepthTags.clear(); f2++; } } - } - /*if (!frameAdded && fframe == timelined.getFrameCount() - 1) { - //Add removeTag to other layers - for (int d = 1; d <= timeline.maxDepth; d++) { - if (d == nd) { - continue; - } - ds = timeline.getFrame(fframe).layers.get(d); - if (ds != null && ds.getCharacter() != null) { - RemoveTag rt = new RemoveObject2Tag(timelined.getSwf()); - rt.setTimelined(timelined); - rt.setDepth(d); - timelined.addTag(rt); + + if ((!removeOnly && !lastFrameDepthTags.isEmpty()) || !endsWithRemove) { + //Add removeTag to other layers + for (int d = 1; d <= timeline.maxDepth; d++) { + if (d == nd) { + continue; + } + ds = timeline.getDepthState(f2 - 1, d); + if (ds != null && ds.getCharacter() != null) { + RemoveTag rt = new RemoveObject2Tag(timelined.getSwf()); + rt.setTimelined(timelined); + rt.setDepth(d); + timelined.addTag(rt); + } } - } - for (int mf = 0; mf < moveFrameCount; mf++) { + ShowFrameTag sf = new ShowFrameTag(timelined.getSwf()); sf.setTimelined(timelined); timelined.addTag(sf); + timelined.setFrameCount(timelined.getFrameCount() + 1); } - }*/ + } break; } }