Ticket #2483: rotate.patch
File rotate.patch, 3.2 KB (added by , 16 years ago) |
---|
-
Users/mueck/dev/josm/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
55 55 * @author imi 56 56 */ 57 57 public class SelectAction extends MapMode implements SelectionEnded { 58 58 public static boolean needMouseMove = false; 59 59 enum Mode { move, rotate, select } 60 60 private Mode mode = null; 61 61 private long mouseDownTime = 0; … … 155 155 // do not count anything as a move if it lasts less than 100 milliseconds. 156 156 if ((mode == Mode.move) && (System.currentTimeMillis() - mouseDownTime < initialMoveDelay)) return; 157 157 158 if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0) 159 return; 158 if(mode != Mode.rotate) // button is pressed in rotate mode 159 if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0) 160 return; 160 161 161 if (mode == Mode.move) {162 if (mode == Mode.move) 162 163 setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); 163 }164 164 165 165 if (mousePos == null) { 166 166 mousePos = e.getPoint(); … … 247 245 didMove = true; 248 246 } 249 247 248 /** 249 * Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. 250 * 251 */ 252 @Override public void mouseMoved(MouseEvent e) { 253 if (needMouseMove && mode == Mode.rotate) 254 mouseDragged(e); 255 } 256 250 257 private Collection<OsmPrimitive> getNearestCollectionVirtual(Point p, boolean allSegements) { 251 258 MapView c = Main.map.mapView; 252 259 int snapDistance = Main.pref.getInteger("mappaint.node.virtual-snap-distance", 8); -
Users/mueck/dev/josm/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.tools; 3 3 4 import org.openstreetmap.josm.tools.Shortcut;5 import org.openstreetmap.josm.Main;6 import org.openstreetmap.josm.tools.PlatformHookUnixoid;7 8 4 import java.awt.event.KeyEvent; 9 import java.lang.reflect.*;10 5 import java.io.IOException; 6 import java.lang.reflect.InvocationHandler; 7 import java.lang.reflect.Method; 8 import java.lang.reflect.Proxy; 9 11 10 import javax.swing.UIManager; 12 11 12 import org.openstreetmap.josm.Main; 13 import org.openstreetmap.josm.actions.mapmode.SelectAction; 14 13 15 /** 14 16 * see PlatformHook.java 15 17 */ … … 39 41 // by closing all its windows. 40 42 System.out.println("Failed to register with OSX: " + ex); 41 43 } 44 45 // Ctrl + mouse 1 is suppressing mouseDragged events 46 SelectAction.needMouseMove = true; 42 47 } 43 48 public Object invoke (Object proxy, Method method, Object[] args) throws Throwable { 44 49 Boolean handled = Boolean.TRUE;