Changeset 390 in josm for trunk/src/org


Ignore:
Timestamp:
2007-10-15T01:42:03+02:00 (17 years ago)
Author:
framm
Message:
  • do not count anything as a move if it lasts less than 100 milliseconds.
File:
1 edited

Legend:

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

    r383 r390  
    4343        enum Mode { move, rotate, select }
    4444        private Mode mode = null;
     45        private long mouseDownTime = 0;
    4546
    4647        /**
     
    111112        @Override public void mouseDragged(MouseEvent e) {
    112113                if (mode == Mode.select) return;
     114               
     115                // do not count anything as a move if it lasts less than 100 milliseconds.
     116                if ((mode == Mode.move) && (System.currentTimeMillis() - mouseDownTime < 100)) return;
    113117
    114118                if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0)
     
    180184                boolean alt = (e.getModifiers() & ActionEvent.ALT_MASK) != 0;
    181185                boolean shift = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0;
    182 
    183                 Collection<OsmPrimitive> sel = Main.ds.getSelected();
     186               
     187                mouseDownTime = System.currentTimeMillis();
     188
    184189                OsmPrimitive osm = Main.map.mapView.getNearest(e.getPoint());
    185190                Collection<OsmPrimitive> osmColl;
Note: See TracChangeset for help on using the changeset viewer.