- Timestamp:
- 2017-04-03T20:31:17+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r11831 r11832 935 935 } 936 936 937 /*938 * We use these for quick, hackish calculations. They are temporary only and intentionally not inserted into the tileCache.939 */940 private Tile tempCornerTile(Tile t) {941 int x = t.getXtile() + 1;942 int y = t.getYtile() + 1;943 int zoom = t.getZoom();944 Tile tile = getTile(x, y, zoom);945 if (tile != null)946 return tile;947 return new Tile(tileSource, x, y, zoom);948 }949 950 937 private Tile getOrCreateTile(TilePosition tilePosition) { 951 938 return getOrCreateTile(tilePosition.getX(), tilePosition.getY(), tilePosition.getZoom()); … … 957 944 tile = new Tile(tileSource, x, y, zoom); 958 945 tileCache.addTile(tile); 959 }960 961 if (!tile.isLoaded()) {962 tile.loadPlaceholderFromCache(tileCache);963 946 } 964 947 return tile; … … 1117 1100 List<TilePosition> missed = Collections.synchronizedList(new ArrayList<>()); 1118 1101 ts.visitTiles(tile -> { 1119 Image img = getLoadedTileImage(tile); 1120 if (img == null) { 1102 boolean miss = false; 1103 Image img = null; 1104 if (!tile.isLoaded() || tile.hasError()) { 1105 miss = true; 1106 } else { 1107 img = getLoadedTileImage(tile); 1108 if (img == null) { 1109 miss = true; 1110 } 1111 } 1112 if (miss) { 1121 1113 missed.add(new TilePosition(tile)); 1122 1114 return; … … 1148 1140 // However, we need to return *all* tiles to the callers, so force creation here. 1149 1141 for (Tile tile : ts.allTilesCreate()) { 1150 Image img = getLoadedTileImage(tile); 1151 if (img == null || tile.hasError()) { 1152 if (Main.isDebugEnabled()) { 1153 Main.debug("missed tile: " + tile); 1154 } 1142 boolean miss = false; 1143 Image img = null; 1144 if (!tile.isLoaded()|| tile.hasError()) { 1145 miss = true; 1146 } else { 1147 img = getLoadedTileImage(tile); 1148 if (img == null) { 1149 miss = true; 1150 } 1151 } 1152 if (miss) { 1155 1153 missedTiles.add(tile); 1156 1154 continue;
Note:
See TracChangeset
for help on using the changeset viewer.