Changeset 1797 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2009-07-16T00:41:38+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r1764 r1797 321 321 */ 322 322 public void recalculateCenterScale(BoundingXYVisitor box) { 323 if (box == null) {323 if (box == null) { 324 324 box = new BoundingXYVisitor(); 325 325 } 326 if (box.getBounds() == null) {326 if (box.getBounds() == null) { 327 327 box.visit(getProjection().getWorldBounds()); 328 328 } 329 if (!box.hasExtend()) {329 if (!box.hasExtend()) { 330 330 box.enlargeBoundingBox(); 331 331 } -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r1728 r1797 138 138 */ 139 139 public Point getPoint(EastNorth p) { 140 if (null == p)140 if (null == p) 141 141 return new Point(); 142 142 double x = (p.east()-center.east())/scale + getWidth()/2; … … 146 146 147 147 public Point getPoint(LatLon latlon) { 148 if (latlon == null)148 if (latlon == null) 149 149 return new Point(); 150 else if (latlon instanceof CachedLatLon)150 else if (latlon instanceof CachedLatLon) 151 151 return getPoint(((CachedLatLon)latlon).getEastNorth()); 152 152 else … … 165 165 /* TODO: check that newCenter is really inside visible world and that scale is correct, don't allow zooming out to much */ 166 166 boolean rep = false; 167 if(!newCenter.equals(center)) 168 { 167 if (!newCenter.equals(center)) { 169 168 EastNorth oldCenter = center; 170 169 center = newCenter; … … 172 171 firePropertyChange("center", oldCenter, newCenter); 173 172 } 174 if(scale != newScale) 175 { 173 if (scale != newScale) { 176 174 double oldScale = scale; 177 175 scale = newScale; … … 188 186 189 187 public void zoomTo(LatLon newCenter) { 190 if (newCenter instanceof CachedLatLon)188 if (newCenter instanceof CachedLatLon) 191 189 zoomTo(((CachedLatLon)newCenter).getEastNorth(), scale); 192 190 else
Note:
See TracChangeset
for help on using the changeset viewer.