From 096bef7fa50169ae7d92034d3f3e86b4d74e3b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 4 May 2025 14:35:31 +0200 Subject: [PATCH] Touchpoint on freetransform --- .../decompiler/flash/gui/ImagePanel.java | 29 +++++++++++++------ .../decompiler/flash/gui/TimelinedMaker.java | 3 ++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index ebfa3e4de..6622b6319 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -1430,8 +1430,12 @@ public final class ImagePanel extends JPanel implements MediaDisplay { } selectedPointsOriginalValues = newPointsUnderCursorValues; - - if (selectionMode && depthStateUnderCursor != null && selectedDepths.contains(depthStateUnderCursor.depth)) { + + if ( + (selectionMode && depthStateUnderCursor != null && selectedDepths.contains(depthStateUnderCursor.depth)) + || + (!selectionMode && doFreeTransform && depthStateUnderCursor != null) + ) { Matrix matrix = new Matrix(); if (depthStateUnderCursor.matrix != null) { matrix = matrix.preConcatenate(new Matrix(depthStateUnderCursor.matrix)); @@ -1736,7 +1740,13 @@ public final class ImagePanel extends JPanel implements MediaDisplay { double zoomDouble = getRealZoom(); - if (Configuration.snapToObjects.get() && depthStateUnderCursor != null && !selectedDepths.contains(depthStateUnderCursor.depth)) { + if (Configuration.snapToObjects.get() + && depthStateUnderCursor != null && + !selectedDepths.contains(depthStateUnderCursor.depth) + ) { + System.err.println("depthStateUnderCursor.depth = " + depthStateUnderCursor.depth); + if (!selectedDepths.isEmpty()) + System.err.println("selectedDepths = " + selectedDepths.get(0)); CharacterTag ch = depthStateUnderCursor.getCharacter(); if (ch != null) { if (ch instanceof BoundedTag) { @@ -4600,7 +4610,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { }*/ RenderContext renderContext = new RenderContext(); renderContext.displayObjectCache = displayObjectCache; - if (cursorPosition != null && (!doFreeTransform || transformSelectionMode)) { + if (cursorPosition != null) { // && (!doFreeTransform || transformSelectionMode)) { DisplayPoint touchPoint = new DisplayPoint(cursorPosition); if (touchPointOffset != null) { touchPoint = new DisplayPoint(cursorPosition.x + touchPointOffset.x, cursorPosition.y + touchPointOffset.y); @@ -4756,14 +4766,17 @@ public final class ImagePanel extends JPanel implements MediaDisplay { boolean handCursor = renderContext.mouseOverButton != null || !autoPlayed && !frozenButtons; - if (showObjectsUnderCursor && autoPlayed) { - + if (autoPlayed) { if (!renderContext.stateUnderCursor.isEmpty()) { depthStateUnderCursor = renderContext.stateUnderCursor.get(renderContext.stateUnderCursor.size() - 1); } else { depthStateUnderCursor = null; } - + } else { + depthStateUnderCursor = null; + } + + if (showObjectsUnderCursor && autoPlayed) { boolean first = true; for (int i = renderContext.stateUnderCursor.size() - 1; i >= 0; i--) { DepthState ds = renderContext.stateUnderCursor.get(i); @@ -4789,8 +4802,6 @@ public final class ImagePanel extends JPanel implements MediaDisplay { if (first) { ret.append(DEFAULT_DEBUG_LABEL_TEXT); } - } else { - depthStateUnderCursor = null; } ButtonTag lastMouseOverButton; diff --git a/src/com/jpexs/decompiler/flash/gui/TimelinedMaker.java b/src/com/jpexs/decompiler/flash/gui/TimelinedMaker.java index 9055e126f..743a778d3 100644 --- a/src/com/jpexs/decompiler/flash/gui/TimelinedMaker.java +++ b/src/com/jpexs/decompiler/flash/gui/TimelinedMaker.java @@ -243,6 +243,7 @@ public class TimelinedMaker { } Frame f = new Frame(timeline, framesCnt); DepthState ds = new DepthState(tag.getSwf(), f, f); + ds.depth = 1; ds.characterId = fChId; ds.matrix = new MATRIX(); ds.ratio = 65535; @@ -260,6 +261,7 @@ public class TimelinedMaker { //Fonts are really added to stage in some corner cases like for vertical text. Frame f = new Frame(timeline, 0); DepthState ds = new DepthState(tag.getSwf(), f, f); + ds.depth = 1; ds.characterId = fChId; ds.matrix = new MATRIX(); f.layers.put(1, ds); @@ -271,6 +273,7 @@ public class TimelinedMaker { } else { Frame f = new Frame(timeline, 0); DepthState ds = new DepthState(tag.getSwf(), f, f); + ds.depth = 1; ds.characterId = fChId; ds.matrix = new MATRIX(); f.layers.put(1, ds);