diff --git a/CHANGELOG.md b/CHANGELOG.md index 0002ee6d5..030eea101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ All notable changes to this project will be documented in this file. - [#2404] Quick find in text/script editors - show number of occurences - [#1418] Option to make main window Always on top - [#289] Support for Aero Snap on Windows - +- [#2412] Show coordinates on stage mouse move for up to 2 decimal places + ### Fixed - [#2456] FLA export - NullPointer exception while exporting to CS4 or lower via commandline - Touch point, snap align and snap to objects incorrect position when editing nested layers @@ -3808,6 +3809,7 @@ Major version of SWF to XML export changed to 2. [#2404]: https://www.free-decompiler.com/flash/issues/2404 [#1418]: https://www.free-decompiler.com/flash/issues/1418 [#289]: https://www.free-decompiler.com/flash/issues/289 +[#2412]: https://www.free-decompiler.com/flash/issues/2412 [#2456]: https://www.free-decompiler.com/flash/issues/2456 [#2459]: https://www.free-decompiler.com/flash/issues/2459 [#2427]: https://www.free-decompiler.com/flash/issues/2427 diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index d9de483b2..a55277a22 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -325,7 +325,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { private int hilightEdgeColorStep = 10; private int hilightEdgeColor = 0; - private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.00"); + private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.##"); private JScrollBar horizontalScrollBar; private JScrollBar verticalScrollBar; @@ -5198,7 +5198,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { MouseEvent lastMouseEvent; int frame; int time; - Point cursorPosition; + Point2D cursorPosition; int mouseButton; List selectedDepths; Zoom zoom; @@ -5222,8 +5222,8 @@ public final class ImagePanel extends JPanel implements MediaDisplay { cursorPosition = this.cursorPosition; if (cursorPosition != null) { Point2D p2d = toTransformPoint(cursorPosition); - //p2d = getParentMatrix().inverse().transform(p2d); - cursorPosition = new Point((int) Math.round(p2d.getX() / SWF.unitDivisor), (int) Math.round(p2d.getY() / SWF.unitDivisor)); + //p2d = getParentMatrix().inverse().transform(p2d); + cursorPosition = new Point2D.Double(p2d.getX() / SWF.unitDivisor, p2d.getY() / SWF.unitDivisor); } mouseButton = this.mouseButton; @@ -5244,7 +5244,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { if (cursorPosition != null) { // && (!doFreeTransform || transformSelectionMode)) { DisplayPoint touchPoint = new DisplayPoint(cursorPosition); if (touchPointOffset != null) { - touchPoint = new DisplayPoint(cursorPosition.x + touchPointOffset.x, cursorPosition.y + touchPointOffset.y); + touchPoint = new DisplayPoint((int) Math.round(cursorPosition.getX() + touchPointOffset.x), (int) Math.round(cursorPosition.getY() + touchPointOffset.y)); } renderContext.cursorPosition = new Point((int) (touchPoint.x * SWF.unitDivisor), (int) (touchPoint.y * SWF.unitDivisor)); @@ -5393,7 +5393,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { StringBuilder ret = new StringBuilder(); if (cursorPosition != null && autoPlayed) { - ret.append(" [").append(cursorPosition.x).append(",").append(cursorPosition.y).append("]"); + ret.append(" [").append(formatDouble(cursorPosition.getX() )).append(";").append(formatDouble(cursorPosition.getY())).append("]"); if (showObjectsUnderCursor) { ret.append(" : "); }