Changeset 7000 in josm


Ignore:
Timestamp:
2014-04-25T19:46:38+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #9897 - avoid unwanted rectangle painting when moving map on Mac OS X

File:
1 edited

Legend:

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

    r6993 r7000  
    6565 * If no object is under the mouse, move all selected objects (if any)
    6666 *
    67  * On Mac OS, Ctrl + mouse button 1 simulates right click (map move), so the
     67 * On Mac OS X, Ctrl + mouse button 1 simulates right click (map move), so the
    6868 * feature "selection remove" is disabled on this platform.
    6969 */
     
    111111
    112112    private Mode mode = null;
    113     private SelectionManager selectionManager;
     113    private final SelectionManager selectionManager;
    114114    private boolean cancelDrawMode = false;
    115115    private boolean drawTargetHighlight;
     
    500500
    501501        cancelDrawMode = true;
    502         if (mode == Mode.select)
    503             return;
     502        if (mode == Mode.select) {
     503            // Unregisters selectionManager if ctrl has been pressed after mouse click on Mac OS X in order to move the map
     504            if (ctrl && Main.isPlatformOsx()) {
     505                selectionManager.unregister(mv);
     506                mv.requestClearRect();
     507                // Make sure correct cursor is displayed
     508                mv.setNewCursor(Cursor.MOVE_CURSOR, this);
     509            }
     510            return;
     511        }
    504512
    505513        // do not count anything as a move if it lasts less than 100 milliseconds.
     
    567575    }
    568576
    569 
    570 
    571577    @Override
    572578    public void mouseExited(MouseEvent e) {
     
    575581        }
    576582    }
    577 
    578583
    579584    @Override
Note: See TracChangeset for help on using the changeset viewer.