Changeset 14985 in josm for trunk/src/org
- Timestamp:
- 2019-04-11T15:38:25+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r14734 r14985 302 302 break; 303 303 case DOWNLOAD: 304 modeDownload( new BoundingXYVisitor());304 modeDownload(); 305 305 break; 306 306 } … … 395 395 } 396 396 397 private void modeDownload( BoundingXYVisitor v) {397 private void modeDownload() { 398 398 if (lastZoomTime > 0 && 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) { … … 407 408 if (lastZoomTime == -1 || lastZoomArea == -1 || lastZoomArea > s) { 408 409 lastZoomArea = s-1; 409 v.visit(dataSources.get(lastZoomArea).bounds);410 bbox = dataSources.get(lastZoomArea).bounds; 410 411 } else if (lastZoomArea > 0) { 411 412 lastZoomArea -= 1; 412 v.visit(dataSources.get(lastZoomArea).bounds);413 bbox = dataSources.get(lastZoomArea).bounds; 413 414 } else { 414 415 lastZoomArea = -1; 415 416 Area sourceArea = getLayerManager().getActiveDataSet().getDataSourceArea(); 416 417 if (sourceArea != null) { 417 v.visit(new Bounds(sourceArea.getBounds2D()));418 bbox = new Bounds(sourceArea.getBounds2D()); 418 419 } 419 420 } … … 423 424 lastZoomArea = -1; 424 425 } 425 } 426 MainApplication.getMap().mapView.zoomTo(v); 426 if (bbox != null) { 427 MainApplication.getMap().mapView.zoomTo(bbox); 428 } 429 } 427 430 } 428 431 -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r14837 r14985 811 811 if (viewport == null) return; 812 812 if (viewport.getBounds() != null) { 813 BoundingXYVisitor v = new BoundingXYVisitor(); 814 v.visit(viewport.getBounds()); 815 zoomTo(v); 813 zoomTo(viewport.getBounds()); 816 814 } else { 817 815 zoomTo(viewport.getCenter(), viewport.getScale(), true);
Note:
See TracChangeset
for help on using the changeset viewer.