Changeset 12725 in josm for trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
- Timestamp:
- 2017-09-04T20:19:23+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r12636 r12725 516 516 * @return The point on screen where "point" would be drawn, relative to the own top/left. 517 517 */ 518 public Point2D getPoint2D( LatLon latlon) {518 public Point2D getPoint2D(ILatLon latlon) { 519 519 if (latlon == null) { 520 520 return new Point(); 521 521 } else { 522 return getPoint2D(latlon.getEastNorth()); 523 } 522 return getPoint2D(latlon.getEastNorth(Main.getProjection())); 523 } 524 } 525 526 /** 527 * Return the point on the screen where this Coordinate would be. 528 * 529 * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)} 530 * @param latlon The point, where this geopoint would be drawn. 531 * @return The point on screen where "point" would be drawn, relative to the own top/left. 532 */ 533 public Point2D getPoint2D(LatLon latlon) { 534 return getPoint2D((ILatLon) latlon); 524 535 } 525 536 … … 551 562 * @return point 552 563 * @see #getPoint2D(LatLon) 553 */ 554 public Point getPoint(LatLon latlon) { 564 * @since 12725 565 */ 566 public Point getPoint(ILatLon latlon) { 555 567 Point2D d = getPoint2D(latlon); 556 568 return new Point((int) d.getX(), (int) d.getY()); 569 } 570 571 /** 572 * looses precision, may overflow (depends on p and current scale) 573 * @param latlon lat/lon 574 * @return point 575 * @see #getPoint2D(LatLon) 576 */ 577 public Point getPoint(LatLon latlon) { 578 return getPoint((ILatLon) latlon); 557 579 } 558 580 … … 690 712 * Zoom to given lat/lon. 691 713 * @param newCenter new center coordinates 714 * @since 12725 715 */ 716 public void zoomTo(ILatLon newCenter) { 717 zoomTo(Projections.project(newCenter)); 718 } 719 720 /** 721 * Zoom to given lat/lon. 722 * @param newCenter new center coordinates 692 723 */ 693 724 public void zoomTo(LatLon newCenter) { 694 zoomTo( Projections.project(newCenter));725 zoomTo((ILatLon) newCenter); 695 726 } 696 727
Note:
See TracChangeset
for help on using the changeset viewer.