Changeset 11831 in josm


Ignore:
Timestamp:
2017-04-03T17:52:40+02:00 (2 years ago)
Author:
bastiK
Message:

see #7427 - use integer operations on tile index when possible (instead of EastNorth or LatLon rectangles)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r11829 r11831  
    11611161
    11621162            Rectangle2D sourceRect = coordinateConverter.getRectangleForTile(tile);
    1163             if (!sourceRect.intersects(borderRect)) {
     1163            Rectangle2D clipRect;
     1164            if (tileSource.isInside(tile, border)) {
     1165                clipRect = null;
     1166            } else if (tileSource.isInside(border, tile)) {
     1167                clipRect = borderRect;
     1168            } else {
    11641169                continue;
    11651170            }
    1166             drawImageInside(g, img, sourceRect, borderRect);
     1171            drawImageInside(g, img, sourceRect, clipRect);
    11671172        }
    11681173        return missedTiles;
     
    12711276        }
    12721277
     1278        protected TileSet(TileRange range) {
     1279            super(range);
     1280            sanitize();
     1281        }
     1282
    12731283        /**
    12741284         * null tile set
     
    15901600                    continue;
    15911601                }
    1592                 Tile t2 = tempCornerTile(missed);
    1593                 TileSet ts2 = getTileSet(getShiftedLatLon(tileSource.tileXYToLatLon(missed)),
    1594                                          getShiftedLatLon(tileSource.tileXYToLatLon(t2)), newzoom);
     1602                TileSet ts2 = new TileSet(tileSource.getCoveringTileRange(missed, newzoom));
    15951603                // Instantiating large TileSets is expensive. If there are no loaded tiles, don't bother even trying.
    15961604                if (ts2.allLoadedTiles().isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.