Changeset 10343 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-06-08T23:01:38+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r10342 r10343 47 47 import org.openstreetmap.josm.data.projection.Projection; 48 48 import org.openstreetmap.josm.data.projection.Projections; 49 import org.openstreetmap.josm.gui.MapViewState.MapViewPoint; 49 50 import org.openstreetmap.josm.gui.download.DownloadDialog; 50 51 import org.openstreetmap.josm.gui.help.Helpful; … … 365 366 366 367 public ProjectionBounds getProjectionBounds() { 367 return new ProjectionBounds( 368 new EastNorth( 369 center.east() - getWidth()/2.0*scale, 370 center.north() - getHeight()/2.0*scale), 371 new EastNorth( 372 center.east() + getWidth()/2.0*scale, 373 center.north() + getHeight()/2.0*scale)); 368 return new MapViewState(this).getViewArea().getProjectionBounds(); 374 369 } 375 370 … … 383 378 /* FIXME: replace with better method - used by Main to reset Bounds when projection changes, don't use otherwise */ 384 379 public Bounds getRealBounds() { 385 return new Bounds( 386 getProjection().eastNorth2latlon(new EastNorth( 387 center.east() - getWidth()/2.0*scale, 388 center.north() - getHeight()/2.0*scale)), 389 getProjection().eastNorth2latlon(new EastNorth( 390 center.east() + getWidth()/2.0*scale, 391 center.north() + getHeight()/2.0*scale))); 380 return new MapViewState(this).getViewArea().getCornerBounds(); 392 381 } 393 382 … … 408 397 409 398 public ProjectionBounds getProjectionBounds(Rectangle r) { 410 EastNorth p1 = getEastNorth(r.x, r.y); 411 EastNorth p2 = getEastNorth(r.x + r.width, r.y + r.height); 412 ProjectionBounds pb = new ProjectionBounds(p1); 413 pb.extend(p2); 414 return pb; 399 MapViewState state = new MapViewState(this); 400 MapViewPoint p1 = state.getForView(r.getMinX(), r.getMinY()); 401 MapViewPoint p2 = state.getForView(r.getMaxX(), r.getMaxY()); 402 return p1.rectTo(p2).getProjectionBounds(); 415 403 } 416 404
Note:
See TracChangeset
for help on using the changeset viewer.