Changeset 4858 in josm
- Timestamp:
- 2012-01-23T15:17:45+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r4834 r4858 78 78 else 79 79 { 80 81 // find out whether some data has already been downloaded82 Area present = null;83 80 Area toDownload = null; 84 DataSet ds = Main.main.getCurrentDataSet(); 85 if (ds != null) { 86 present = ds.getDataSourceArea(); 87 } 88 if (present != null && !present.isEmpty()) { 89 toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat)); 90 toDownload.subtract(present); 91 if (!toDownload.isEmpty()) 92 { 93 // the result might not be a rectangle (L shaped etc) 94 Rectangle2D downloadBounds = toDownload.getBounds2D(); 95 minlat = downloadBounds.getMinY(); 96 minlon = downloadBounds.getMinX(); 97 maxlat = downloadBounds.getMaxY(); 98 maxlon = downloadBounds.getMaxX(); 99 } 100 } 101 if((toDownload != null) && toDownload.isEmpty()) 81 if (!newLayer) { 82 // find out whether some data has already been downloaded 83 Area present = null; 84 DataSet ds = Main.main.getCurrentDataSet(); 85 if (ds != null) { 86 present = ds.getDataSourceArea(); 87 } 88 if (present != null && !present.isEmpty()) { 89 toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat)); 90 toDownload.subtract(present); 91 if (!toDownload.isEmpty()) 92 { 93 // the result might not be a rectangle (L shaped etc) 94 Rectangle2D downloadBounds = toDownload.getBounds2D(); 95 minlat = downloadBounds.getMinY(); 96 minlon = downloadBounds.getMinX(); 97 maxlat = downloadBounds.getMaxY(); 98 maxlon = downloadBounds.getMaxX(); 99 } 100 } 101 } 102 if (toDownload != null && toDownload.isEmpty()) 102 103 { 103 104 System.out.println("RemoteControl: no download necessary");
Note:
See TracChangeset
for help on using the changeset viewer.