- Timestamp:
- 2015-04-17T07:58:04+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r8171 r8200 25 25 import org.openstreetmap.josm.data.DataSource; 26 26 import org.openstreetmap.josm.data.conflict.Conflict; 27 import org.openstreetmap.josm.data.osm.DataSet; 27 28 import org.openstreetmap.josm.data.osm.OsmPrimitive; 28 29 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 268 269 lastZoomTime = -1; 269 270 } 270 ArrayList<DataSource> dataSources = new ArrayList<>(Main.main.getCurrentDataSet().getDataSources()); 271 int s = dataSources.size(); 272 if(s > 0) { 273 if(lastZoomTime == -1 || lastZoomArea == -1 || lastZoomArea > s) { 274 lastZoomArea = s-1; 275 v.visit(dataSources.get(lastZoomArea).bounds); 276 } else if(lastZoomArea > 0) { 277 lastZoomArea -= 1; 278 v.visit(dataSources.get(lastZoomArea).bounds); 271 DataSet dataset = Main.main.getCurrentDataSet(); 272 if(dataset != null) { 273 ArrayList<DataSource> dataSources = new ArrayList<>(dataset.getDataSources()); 274 int s = dataSources.size(); 275 if(s > 0) { 276 if(lastZoomTime == -1 || lastZoomArea == -1 || lastZoomArea > s) { 277 lastZoomArea = s-1; 278 v.visit(dataSources.get(lastZoomArea).bounds); 279 } else if(lastZoomArea > 0) { 280 lastZoomArea -= 1; 281 v.visit(dataSources.get(lastZoomArea).bounds); 282 } else { 283 lastZoomArea = -1; 284 v.visit(new Bounds(Main.main.getCurrentDataSet().getDataSourceArea().getBounds2D())); 285 } 286 lastZoomTime = System.currentTimeMillis(); 279 287 } else { 288 lastZoomTime = -1; 280 289 lastZoomArea = -1; 281 v.visit(new Bounds(Main.main.getCurrentDataSet().getDataSourceArea().getBounds2D())); 282 } 283 lastZoomTime = System.currentTimeMillis(); 284 } else { 285 lastZoomTime = -1; 286 lastZoomArea = -1; 290 } 287 291 } 288 292 break;
Note:
See TracChangeset
for help on using the changeset viewer.