diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index 3053e46da..e23b9637c 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.configuration.ConfigurationItemChangeListener; import com.jpexs.decompiler.flash.configuration.CustomConfigurationKeys; import com.jpexs.decompiler.flash.configuration.SwfSpecificCustomConfiguration; +import com.jpexs.decompiler.flash.ecma.EcmaNumberToString; import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle; import com.jpexs.decompiler.flash.exporters.commonshape.Matrix; @@ -1457,6 +1458,49 @@ public final class ImagePanel extends JPanel implements MediaDisplay { @Override public void mouseClicked(MouseEvent e) { + if (e.getClickCount() == 2) { + if (Configuration.showGuides.get() && !Configuration.lockGuides.get()) { + Point mousePoint = e.getPoint(); + for (int d = 0; d < guidesX.size(); d++) { + Double guide = guidesX.get(d); + int guideInPanel = (int) Math.round(guide * getRealZoom() + offsetPoint.getX()); + if (mousePoint.x == guideInPanel) { + String newPositionStr = ViewMessages.showInputDialog(ImagePanel.this, AppStrings.translate("move_guide.position"), AppStrings.translate("move_guide"), EcmaNumberToString.stringFor(guide)); + if (newPositionStr != null) { + try { + double newPosition = Double.parseDouble(newPositionStr); + guidesX.set(d, newPosition); + saveGuides(); + repaint(); + } catch (NumberFormatException nfe) { + //ignore + } + } + return; + } + } + + for (int d = 0; d < guidesY.size(); d++) { + Double guide = guidesY.get(d); + int guideInPanel = (int) Math.round(guide * getRealZoom() + offsetPoint.getY()); + if (mousePoint.y == guideInPanel) { + String newPositionStr = ViewMessages.showInputDialog(ImagePanel.this, AppStrings.translate("move_guide.position"), AppStrings.translate("move_guide"), EcmaNumberToString.stringFor(guide)); + if (newPositionStr != null) { + try { + double newPosition = Double.parseDouble(newPositionStr); + guidesY.set(d, newPosition); + saveGuides(); + repaint(); + } catch (NumberFormatException nfe) { + //ignore + } + } + return; + } + } + } + } + if (e.getClickCount() == 2 && selectionMode && !transformSelectionMode) { DepthState ds = depthStateUnderCursor; diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 981c3a38d..1683c6606 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -1041,4 +1041,7 @@ guides_options.edit = Edit guides... button.grid_options = Grid options grid_options.show_grid = Show grid -grid_options.edit = Edit grid... \ No newline at end of file +grid_options.edit = Edit grid... + +move_guide = Move guide +move_guide.position = Position: \ No newline at end of file