- Timestamp:
- 2017-04-04T11:51:54+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r11535 r11835 624 624 newScale = scaleRound(newScale); 625 625 626 // Align to the pixel grid: 627 // This is a sub-pixel correction to ensure consistent drawing at a certain scale. 628 // For example take 2 nodes, that have a distance of exactly 2.6 pixels. 629 // Depending on the offset, the distance in rounded or truncated integer 630 // pixels will be 2 or 3. It is preferable to have a consistent distance 631 // and not switch back and forth as the viewport moves. This can be achieved by 632 // locking an arbitrary point to integer pixel coordinates. (Here the EastNorth 633 // origin is used as reference point.) 634 // Note that the normal right mouse button drag moves the map by integer pixel 635 // values, so it is not an issue in this case. It only shows when zooming 636 // in & back out, etc. 637 MapViewState mvs = getState().usingScale(newScale).movedTo(state.getCenterAtPixel(), newCenter); 638 Point2D enOrigin = mvs.getPointFor(new EastNorth(0, 0)).getInView(); 639 Point2D enOriginAligned = new Point2D.Double(Math.round(enOrigin.getX()), Math.round(enOrigin.getY())); 640 EastNorth enShift = mvs.getForView(enOriginAligned.getX(), enOriginAligned.getY()).getEastNorth(); 641 newCenter = newCenter.subtract(enShift); 642 626 643 if (!newCenter.equals(getCenter()) || !Utils.equalsEpsilon(getScale(), newScale)) { 627 644 if (!initial) { -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r11834 r11835 1142 1142 boolean miss = false; 1143 1143 Image img = null; 1144 if (!tile.isLoaded()|| tile.hasError()) { 1144 if (!tile.isLoaded() || tile.hasError()) { 1145 1145 miss = true; 1146 1146 } else {
Note:
See TracChangeset
for help on using the changeset viewer.