trackeditor: add zoom in/out with control + mousewheel

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9304 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2024-02-03 17:02:03 +00:00
parent 02620f9ddf
commit c5bcd12fca
2 changed files with 16 additions and 11 deletions

View File

@ -1232,7 +1232,21 @@ public class CircuitView extends JComponent implements KeyListener, MouseListene
screenToReal(e, mousePoint);
getParent().dispatchEvent(e);
if (e.isControlDown())
{
int n = e.getWheelRotation();
for ( int i = 0; i < Math.abs( n ); i++ )
{
if ( n < 0 )
incZoomFactor();
else
decZoomFactor();
}
}
else
{
getParent().dispatchEvent(e);
}
if (editorFrame.getCursorCoordinates())
{
@ -1268,15 +1282,6 @@ public class CircuitView extends JComponent implements KeyListener, MouseListene
}
// /** input events management */
// /*
// * public void mouseWheelMoved( MouseWheelEvent e ) { int n =
// * e.getWheelRotation();
// *
// * for ( int i = 0; i < Math.abs( n ); i++ ) { if ( n < 0 )
// incZoomFactor();
// * else decZoomFactor(); } }
// */
//
// /**
// * Drags end of handledShape (straight segment)
// *

View File

@ -34,7 +34,7 @@ public class Properties
private static Properties instance = new Properties();
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
public final String title = "sd2-trackeditor";
public final String version = "1.4.31";
public final String version = "1.4.32";
private String path;
private double imageScale = 1;