Ticket #17591: 17591.patch
File 17591.patch, 1.7 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/actions/AutoScaleAction.java
399 399 System.currentTimeMillis() - lastZoomTime > Config.getPref().getLong("zoom.bounds.reset.time", TimeUnit.SECONDS.toMillis(10))) { 400 400 lastZoomTime = -1; 401 401 } 402 Bounds bbox = null; 402 403 final DataSet dataset = getLayerManager().getActiveDataSet(); 403 404 if (dataset != null) { 404 405 List<DataSource> dataSources = new ArrayList<>(dataset.getDataSources()); … … 407 408 if (lastZoomTime == -1 || lastZoomArea == -1 || lastZoomArea > s) { 408 409 lastZoomArea = s-1; 409 410 v.visit(dataSources.get(lastZoomArea).bounds); 411 bbox = dataSources.get(lastZoomArea).bounds; 410 412 } else if (lastZoomArea > 0) { 411 413 lastZoomArea -= 1; 412 414 v.visit(dataSources.get(lastZoomArea).bounds); 415 bbox = dataSources.get(lastZoomArea).bounds; 413 416 } else { 414 417 lastZoomArea = -1; 415 418 Area sourceArea = getLayerManager().getActiveDataSet().getDataSourceArea(); … … 423 426 lastZoomArea = -1; 424 427 } 425 428 } 426 MainApplication.getMap().mapView.zoomTo(v); 429 if (bbox != null) 430 MainApplication.getMap().mapView.zoomTo(bbox); 431 else 432 MainApplication.getMap().mapView.zoomTo(v); 427 433 } 428 434 429 435 @Override