Changeset 1634 in josm for trunk/src


Ignore:
Timestamp:
2009-06-06T13:26:19+02:00 (15 years ago)
Author:
stoecker
Message:

fix #2483 - patch by dmuecke - rotate does not work under Mac OS X

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r1557 r1634  
    5656 */
    5757public class SelectAction extends MapMode implements SelectionEnded {
    58 
     58    public static boolean needMouseMove = false;
    5959    enum Mode { move, rotate, select }
    6060    private Mode mode = null;
     
    156156        if ((mode == Mode.move) && (System.currentTimeMillis() - mouseDownTime < initialMoveDelay)) return;
    157157
    158         if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0)
    159             return;
    160 
    161         if (mode == Mode.move) {
     158        if(mode != Mode.rotate) // button is pressed in rotate mode
     159            if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0)
     160                return;
     161
     162        if (mode == Mode.move)
    162163            setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
    163         }
    164164
    165165        if (mousePos == null) {
     
    246246
    247247        didMove = true;
     248    }
     249
     250    /**
     251     * Mac OSX simulates with  ctrl + mouse 1  the second mouse button hence no dragging events get fired.
     252     *
     253     */
     254    @Override public void mouseMoved(MouseEvent e) {
     255        if (needMouseMove && mode == Mode.rotate)
     256            mouseDragged(e);
    248257    }
    249258
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r1415 r1634  
    22package org.openstreetmap.josm.tools;
    33
    4 import org.openstreetmap.josm.tools.Shortcut;
     4import java.awt.event.KeyEvent;
     5import java.io.IOException;
     6import java.lang.reflect.InvocationHandler;
     7import java.lang.reflect.Method;
     8import java.lang.reflect.Proxy;
     9
     10import javax.swing.UIManager;
     11
    512import org.openstreetmap.josm.Main;
    6 import org.openstreetmap.josm.tools.PlatformHookUnixoid;
    7 
    8 import java.awt.event.KeyEvent;
    9 import java.lang.reflect.*;
    10 import java.io.IOException;
    11 import javax.swing.UIManager;
     13import org.openstreetmap.josm.actions.mapmode.SelectAction;
    1214
    1315/**
     
    4042            System.out.println("Failed to register with OSX: " + ex);
    4143        }
     44
     45        // Ctrl + mouse 1 is suppressing mouseDragged events
     46        SelectAction.needMouseMove = true;
    4247    }
    4348    public Object invoke (Object proxy, Method method, Object[] args) throws Throwable {
Note: See TracChangeset for help on using the changeset viewer.