Changeset 746 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2008-08-05T02:14:58+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r731 r746 84 84 for (OsmPrimitive osm : sel) 85 85 osm.visit(v); 86 // special case to zoom nicely to one single node 87 if (v.min != null && v.max != null && v.min.north() == v.max.north() && v.min.east() == v.max.east()) { 88 EastNorth en = Main.proj.latlon2eastNorth(new LatLon(0.001, 0.001)); 89 v.min = new EastNorth(v.min.east()-en.east(), v.min.north()-en.north()); 90 v.max = new EastNorth(v.max.east()+en.east(), v.max.north()+en.north()); 91 } 86 // increase bbox by 0.001 degrees on each side. this is required 87 // especially if the bbox contains one single node, but helpful 88 // in most other cases as well. 89 // if (v.min != null && v.max != null && v.min.north() == v.max.north() && v.min.east() == v.max.east()) { 90 EastNorth en = Main.proj.latlon2eastNorth(new LatLon(0.001, 0.001)); 91 v.min = new EastNorth(v.min.east()-en.east(), v.min.north()-en.north()); 92 v.max = new EastNorth(v.max.east()+en.east(), v.max.north()+en.north()); 92 93 } 93 94 return v; -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r726 r746 58 58 59 59 public void download(DownloadAction action, double minlat, double minlon, double maxlat, double maxlon) { 60 // Swap min and max if user has specified them the wrong way round 61 // (easy to do if you are crossing 0, for example) 62 if (minlat > maxlat) { 63 double t = minlat; minlat = maxlat; maxlat = t; 64 } 65 if (minlon > maxlon) { 66 double t = minlon; minlon = maxlon; maxlon = t; 67 } 60 // Swap min and max if user has specified them the wrong way round 61 // (easy to do if you are crossing 0, for example) 62 // FIXME should perhaps be done in download dialog? 63 if (minlat > maxlat) { 64 double t = minlat; minlat = maxlat; maxlat = t; 65 } 66 if (minlon > maxlon) { 67 double t = minlon; minlon = maxlon; maxlon = t; 68 } 68 69 69 Task task = new Task(action.dialog == null || action.dialog.newLayer.isSelected(), new BoundingBoxDownloader(minlat, minlon, maxlat, maxlon)); 70 Task task = new Task(action != null && (action.dialog == null || action.dialog.newLayer.isSelected()), new BoundingBoxDownloader(minlat, minlon, maxlat, maxlon)); 70 71 Main.worker.execute(task); 71 72 }
Note:
See TracChangeset
for help on using the changeset viewer.