From 52270d33b00f39c0258f3f811cf31f198a46d6be Mon Sep 17 00:00:00 2001 From: Exund Date: Mon, 29 Nov 2021 19:39:23 +0100 Subject: [PATCH] Display depth when hovering ImagePanel Display the depth of the objects under the cursor --- .../src/com/jpexs/decompiler/flash/timeline/DepthState.java | 2 ++ .../src/com/jpexs/decompiler/flash/timeline/Timeline.java | 1 + src/com/jpexs/decompiler/flash/gui/ImagePanel.java | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/DepthState.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/DepthState.java index f8a14b7a4..cb35570cd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/DepthState.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/DepthState.java @@ -38,6 +38,7 @@ import java.util.concurrent.atomic.AtomicLong; * @author JPEXS */ public class DepthState { + public int depth = -1; public int characterId = -1; @@ -113,6 +114,7 @@ public class DepthState { time = obj.time; placeObjectTag = obj.placeObjectTag; minPlaceObjectNum = obj.minPlaceObjectNum; + depth = obj.depth; if (sameInstance) { time++; instanceId = obj.instanceId; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java index 73afed9f5..060902951 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java @@ -312,6 +312,7 @@ public class Timeline { DepthState fl = frame.layers.get(depth); if (fl == null) { frame.layers.put(depth, fl = new DepthState(swf, frame)); + fl.depth = depth; } frame.layersChanged = true; fl.placeObjectTag = po; diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index b71a697fb..f7929eb35 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -2207,6 +2207,10 @@ public final class ImagePanel extends JPanel implements MediaDisplay { first = false; CharacterTag c = swf.getCharacter(ds.characterId); ret.append(c.toString()); + if(ds.depth > 0) { + ret.append(" Depth: "); + ret.append(ds.depth); + } } if (first) {