Changeset 1823 in josm for trunk/src/org/openstreetmap/josm/gui/MapView.java
- Timestamp:
- 2009-07-22T20:33:41+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r1820 r1823 13 13 import java.awt.event.MouseEvent; 14 14 import java.awt.event.MouseMotionListener; 15 import java.awt.geom.GeneralPath; 15 16 import java.awt.image.BufferedImage; 16 17 import java.util.ArrayList; … … 29 30 import org.openstreetmap.josm.actions.MoveAction; 30 31 import org.openstreetmap.josm.actions.mapmode.MapMode; 32 import org.openstreetmap.josm.data.Bounds; 31 33 import org.openstreetmap.josm.data.ProjectionBounds; 32 34 import org.openstreetmap.josm.data.SelectionChangedListener; … … 35 37 import org.openstreetmap.josm.data.osm.OsmPrimitive; 36 38 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 39 import org.openstreetmap.josm.data.coor.LatLon; 37 40 import org.openstreetmap.josm.gui.layer.Layer; 38 41 import org.openstreetmap.josm.gui.layer.MapViewPaintable; … … 295 298 // draw world borders 296 299 tempG.setColor(Color.WHITE); 297 ProjectionBounds b = getProjection().getWorldBounds(); 298 Point min = getPoint(b.min); 299 Point max = getPoint(b.max); 300 int x1 = Math.min(min.x, max.x); 301 int y1 = Math.min(min.y, max.y); 302 int x2 = Math.max(min.x, max.x); 303 int y2 = Math.max(min.y, max.y); 304 if (x1 > 0 || y1 > 0 || x2 < getWidth() || y2 < getHeight()) { 305 tempG.drawRect(x1, y1, x2-x1+1, y2-y1+1); 300 GeneralPath path = new GeneralPath(); 301 Bounds b = getProjection().getWorldBoundsLatLon(); 302 double lat = b.min.lat(); 303 double lon = b.min.lon(); 304 305 Point p = getPoint(b.min); 306 path.moveTo(p.x, p.y); 307 308 double max = b.max.lat(); 309 for(; lat <= max; lat += 1.0) 310 { 311 p = getPoint(new LatLon(lat >= max ? max : lat, lon)); 312 path.lineTo(p.x, p.y); 313 } 314 lat = max; max = b.max.lon(); 315 for(; lon <= max; lon += 1.0) 316 { 317 p = getPoint(new LatLon(lat, lon >= max ? max : lon)); 318 path.lineTo(p.x, p.y); 319 } 320 lon = max; max = b.min.lat(); 321 for(; lat >= max; lat -= 1.0) 322 { 323 p = getPoint(new LatLon(lat <= max ? max : lat, lon)); 324 path.lineTo(p.x, p.y); 325 } 326 lat = max; max = b.min.lon(); 327 for(; lon >= max; lon -= 1.0) 328 { 329 p = getPoint(new LatLon(lat, lon <= max ? max : lon)); 330 path.lineTo(p.x, p.y); 306 331 } 307 332 … … 309 334 playHeadMarker.paint(tempG, this); 310 335 } 336 tempG.draw(path); 311 337 312 338 g.drawImage(offscreenBuffer, 0, 0, null); … … 322 348 } 323 349 if (box.getBounds() == null) { 324 box.visit(getProjection().getWorldBounds ());350 box.visit(getProjection().getWorldBoundsLatLon()); 325 351 } 326 352 if (!box.hasExtend()) {
Note:
See TracChangeset
for help on using the changeset viewer.