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 984419503..712bb87b7 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 @@ -64,6 +64,7 @@ import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.Point; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; @@ -877,13 +878,16 @@ public class Timeline { clips.add(clip); } else { if (renderContext.cursorPosition != null) { + int dx = (int) (viewRect.xMin * unzoom); + int dy = (int) (viewRect.yMin * unzoom); + Point cursorPositionInView = new Point(renderContext.cursorPosition.x - dx, renderContext.cursorPosition.y - dy); if (drawable instanceof DefineSpriteTag) { if (renderContext.stateUnderCursor.size() > stateCount) { renderContext.stateUnderCursor.add(layer); } - } else if (absMat.transform(new ExportRectangle(boundRect)).contains(renderContext.cursorPosition)) { + } else if (absMat.transform(new ExportRectangle(boundRect)).contains(cursorPositionInView)) { Shape shape = drawable.getOutline(dframe, time, layer.ratio, renderContext, absMat, true); - if (shape.contains(renderContext.cursorPosition)) { + if (shape.contains(cursorPositionInView)) { renderContext.stateUnderCursor.add(layer); } } diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index bab1ffa92..3adb85361 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -1085,8 +1085,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { if (_img == null) { return null; } - - return new Point((p.x - _rect.x) * _img.getWidth() / _rect.width, (p.y - _rect.y) * _img.getHeight() / _rect.height); + return new Point((p.x - _rect.x), (p.y - _rect.y)); } private void setAllowMove(boolean allowMove) {