Changeset 600 in josm
- Timestamp:
- 2008-04-12T02:08:37+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r469 r600 17 17 import org.openstreetmap.josm.data.osm.Node; 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 import org.openstreetmap.josm.data.osm.Way; 19 20 20 21 /** … … 45 46 itnodes.add((Node)osm); 46 47 } 48 // special case if no single nodes are selected and exactly one way is: 49 // then use the way's nodes 50 if ((nodes.size() == 0) && (sel.size() == 1)) 51 for (OsmPrimitive osm : sel) 52 if (osm instanceof Way) { 53 nodes.addAll(((Way)osm).nodes); 54 itnodes.addAll(((Way)osm).nodes); 55 } 47 56 if (nodes.size() < 3) { 48 57 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least three nodes.")); … … 60 69 itnodes.remove(n); 61 70 for (Node m : itnodes) { 62 double dist = Math.sqrt(n.eastNorth.distance (m.eastNorth));71 double dist = Math.sqrt(n.eastNorth.distanceSq(m.eastNorth)); 63 72 if (dist > distance) { 64 73 nodea = n;
Note:
See TracChangeset
for help on using the changeset viewer.