- Timestamp:
- 2019-04-04T11:34:48+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
r14659 r14960 214 214 double y = center.north() + r*Math.sin(alpha); 215 215 LatLon ll = ProjectionRegistry.getProjection().eastNorth2latlon(new EastNorth(x, y)); 216 if ( ll.isOutSideWorld()) {216 if (new Node(new EastNorth(x, y)).isOutSideWorld()) { 217 217 notifyNodesNotOnCircle(); 218 218 return; -
trunk/src/org/openstreetmap/josm/actions/MoveAction.java
r14397 r14960 152 152 153 153 for (Node n : affectedNodes) { 154 if (n.isLatLonKnown() && n. getCoor().isOutSideWorld()) {154 if (n.isLatLonKnown() && n.isOutSideWorld()) { 155 155 // Revert move 156 156 ((MoveCommand) c).moveAgain(-distx, -disty); -
trunk/src/org/openstreetmap/josm/actions/MoveNodeAction.java
r14397 r14960 52 52 // move the node 53 53 UndoRedoHandler.getInstance().add(new MoveCommand(n, coordinates)); 54 if (n.getCoor().distance(coordinates) > 1) { 55 // see #13538: Avoid rounding error near 180 longitude which moves nodes too far 56 if (coordinates.lon() >= 180.0) { 57 coordinates = new LatLon(coordinates.lat(), Math.nextDown(180.0)); 58 } else if (coordinates.lon() <= -180.0) { 59 coordinates = new LatLon(coordinates.lat(), Math.nextUp(-180.0)); 60 } 61 UndoRedoHandler.getInstance().undo(1); 62 UndoRedoHandler.getInstance().add(new MoveCommand(n, coordinates)); 63 } 54 64 MainApplication.getMap().mapView.repaint(); 55 65 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r14654 r14960 530 530 531 531 if (newNode) { 532 if (n. getCoor().isOutSideWorld()) {532 if (n.isOutSideWorld()) { 533 533 JOptionPane.showMessageDialog( 534 534 MainApplication.getMainFrame(), -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r14670 r14960 416 416 } else if (state == State.IMPROVING) { 417 417 // Checking if the new coordinate is outside of the world 418 if ( mv.getLatLon(mousePos.x, mousePos.y).isOutSideWorld()) {418 if (new Node(mv.getEastNorth(mousePos.x, mousePos.y)).isOutSideWorld()) { 419 419 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 420 420 tr("Cannot add a node outside of the world."), -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r14654 r14960 32 32 import org.openstreetmap.josm.data.UndoRedoHandler; 33 33 import org.openstreetmap.josm.data.coor.EastNorth; 34 import org.openstreetmap.josm.data.coor.LatLon;35 34 import org.openstreetmap.josm.data.osm.DataSet; 36 35 import org.openstreetmap.josm.data.osm.Node; … … 723 722 } 724 723 for (Node n : affectedNodes) { 725 LatLon ll = n.getCoor(); 726 if (ll != null && ll.isOutSideWorld()) { 724 if (n.isOutSideWorld()) { 727 725 // Revert move 728 726 if (c instanceof MoveCommand) { -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r14654 r14960 403 403 return referrers(Way.class).collect(Collectors.toList()); 404 404 } 405 406 /** 407 * Determines if this node is outside of the world. See also #13538. 408 * @return <code>true</code>, if the coordinate is outside the world, compared by using lat/lon and east/north 409 * @since 14960 410 */ 411 public boolean isOutSideWorld() { 412 LatLon ll = getCoor(); 413 if (ll != null) { 414 if (ll.isOutSideWorld()) 415 return true; 416 if (!new Node(ll).getEastNorth().equalsEpsilon(getEastNorth(), 1.0)) { 417 // we get here if a node was moved or created left from -180 or right from +180 418 return true; 419 } 420 } 421 return false; 422 } 405 423 }
Note:
See TracChangeset
for help on using the changeset viewer.