Changeset 2009 in josm for trunk/src/org
- Timestamp:
- 2009-08-30T15:57:46+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r1935 r2009 51 51 import org.openstreetmap.josm.gui.MapFrame; 52 52 import org.openstreetmap.josm.gui.MapView; 53 import org.openstreetmap.josm.gui.OptionPaneUtil;54 53 import org.openstreetmap.josm.gui.layer.Layer; 55 54 import org.openstreetmap.josm.gui.layer.MapViewPaintable; … … 136 135 default: 137 136 Main.map.mapView.setCursor(cursorCrosshair); 138 break;137 break; 139 138 } 140 139 } … … 340 339 if (n != null) { 341 340 // user clicked on node 342 if (selection.isEmpty() ) {341 if (selection.isEmpty() || wayIsFinished) { 343 342 // select the clicked node and do nothing else 344 343 // (this is just a convenience option so that people don't … … 355 354 n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY())); 356 355 if (n.getCoor().isOutSideWorld()) { 357 OptionPaneUtil.showMessageDialog(356 JOptionPane.showMessageDialog( 358 357 Main.parent, 359 358 tr("Cannot add a node outside of the world."), … … 855 854 default: 856 855 EastNorth P = n.getEastNorth(); 857 seg = segs.iterator().next();858 A = seg.a.getEastNorth();859 B = seg.b.getEastNorth();860 double a = P.distanceSq(B);861 double b = P.distanceSq(A);862 double c = A.distanceSq(B);863 q = (a - b + c) / (2*c);864 n.setEastNorth(new EastNorth(B.east() + q * (A.east() - B.east()), B.north() + q * (A.north() - B.north())));856 seg = segs.iterator().next(); 857 A = seg.a.getEastNorth(); 858 B = seg.b.getEastNorth(); 859 double a = P.distanceSq(B); 860 double b = P.distanceSq(A); 861 double c = A.distanceSq(B); 862 q = (a - b + c) / (2*c); 863 n.setEastNorth(new EastNorth(B.east() + q * (A.east() - B.east()), B.north() + q * (A.north() - B.north()))); 865 864 } 866 865 }
Note:
See TracChangeset
for help on using the changeset viewer.