- Timestamp:
- 2017-11-23T15:36:02+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractPasteAction.java
r12636 r13151 4 4 import java.awt.MouseInfo; 5 5 import java.awt.Point; 6 import java.awt.PointerInfo; 6 7 import java.awt.datatransfer.FlavorEvent; 7 8 import java.awt.datatransfer.FlavorListener; … … 75 76 // Observed behaviour: getActionCommand() returns Action.NAME when triggered via menu, but shortcut text when triggered with it 76 77 if (e != null && !getValue(NAME).equals(e.getActionCommand())) { 77 final Point mp = MouseInfo.getPointerInfo().getLocation(); 78 final Point tl = mapView.getLocationOnScreen(); 79 final Point pos = new Point(mp.x-tl.x, mp.y-tl.y); 80 if (mapView.contains(pos)) { 81 mPosition = mapView.getEastNorth(pos.x, pos.y); 78 final PointerInfo pointerInfo = MouseInfo.getPointerInfo(); 79 if (pointerInfo != null) { 80 final Point mp = pointerInfo.getLocation(); 81 final Point tl = mapView.getLocationOnScreen(); 82 final Point pos = new Point(mp.x-tl.x, mp.y-tl.y); 83 if (mapView.contains(pos)) { 84 mPosition = mapView.getEastNorth(pos.x, pos.y); 85 } 82 86 } 83 87 }
Note:
See TracChangeset
for help on using the changeset viewer.