Changeset 2107 in josm for trunk/src/org
- Timestamp:
- 2009-09-12T18:53:18+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r2025 r2107 9 9 import java.awt.Graphics2D; 10 10 import java.awt.Point; 11 import java.awt.Rectangle; 11 12 import java.awt.event.ComponentAdapter; 12 13 import java.awt.event.ComponentEvent; 13 14 import java.awt.event.MouseEvent; 14 15 import java.awt.event.MouseMotionListener; 16 import java.awt.geom.Area; 15 17 import java.awt.geom.GeneralPath; 16 18 import java.awt.image.BufferedImage; … … 366 368 // draw world borders 367 369 tempG.setColor(Color.WHITE); 368 GeneralPath path = new GeneralPath();369 370 Bounds b = getProjection().getWorldBoundsLatLon(); 370 371 double lat = b.min.lat(); … … 372 373 373 374 Point p = getPoint(b.min); 375 376 GeneralPath path = new GeneralPath(); 377 374 378 path.moveTo(p.x, p.y); 375 376 379 double max = b.max.lat(); 377 380 for(; lat <= max; lat += 1.0) … … 399 402 } 400 403 404 int w = offscreenBuffer.getWidth(); 405 int h = offscreenBuffer.getHeight(); 406 407 // Work around OpenJDK having problems when drawing out of bounds 408 final Area border = new Area(path); 409 // Make the viewport 1px larger in every direction to prevent an 410 // additional 1px border when zooming in 411 final Area viewport = new Area(new Rectangle(-1, -1, w + 2, h + 2)); 412 border.intersect(viewport); 413 tempG.draw(border); 414 401 415 if (playHeadMarker != null) { 402 416 playHeadMarker.paint(tempG, this); 403 417 } 404 tempG.draw(path);405 418 406 419 g.drawImage(offscreenBuffer, 0, 0, null);
Note:
See TracChangeset
for help on using the changeset viewer.