Changeset 10651 in josm
- Timestamp:
- 2016-07-26T21:44:16+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/CachedTileLoaderFactory.java
r10235 r10651 60 60 61 61 @Override 62 public TileLoader makeTileLoader(TileLoaderListener listener) {63 return makeTileLoader(listener, null);64 }65 66 @Override67 62 public TileLoader makeTileLoader(TileLoaderListener listener, Map<String, String> inputHeaders) { 68 63 Map<String, String> headers = new ConcurrentHashMap<>(); -
trunk/src/org/openstreetmap/josm/data/imagery/TileLoaderFactory.java
r8624 r10651 13 13 * @since 8526 14 14 */ 15 @FunctionalInterface 15 16 public interface TileLoaderFactory { 16 17 17 18 /** 18 19 * @param listener that will be notified, when tile has finished loading 19 * @return TileLoader that notifies specified listener 20 */ 21 TileLoader makeTileLoader(TileLoaderListener listener); 22 23 /** 24 * @param listener that will be notified, when tile has finished loading 25 * @param headers that will be sent with requests to TileSource 20 * @param headers that will be sent with requests to TileSource. <code>null</code> indicates none 26 21 * @return TileLoader that uses both of above 27 22 */ -
trunk/src/org/openstreetmap/josm/gui/MapViewState.java
r10596 r10651 8 8 import java.awt.geom.Point2D; 9 9 import java.awt.geom.Point2D.Double; 10 import java.awt.geom.Rectangle2D; 10 11 11 12 import javax.swing.JComponent; … … 144 145 145 146 /** 147 * Gets the {@link MapViewPoint} for the given {@link LatLon} coordinate. 148 * @param latlon the position 149 * @return The point for that position. 150 * @since 10651 151 */ 152 public MapViewPoint getPointFor(LatLon latlon) { 153 return getPointFor(getProjection().latlon2eastNorth(latlon)); 154 } 155 156 /** 146 157 * Gets a rectangle representing the whole view area. 147 158 * @return The rectangle. … … 351 362 return projection.eastNorth2latlon(getEastNorth()); 352 363 } 364 365 /** 366 * Add the given offset to this point 367 * @param en The offset in east/north space. 368 * @return The new point 369 * @since 10651 370 */ 371 public MapViewPoint add(EastNorth en) { 372 return new MapViewEastNorthPoint(getEastNorth().add(en)); 373 } 353 374 } 354 375 … … 455 476 return projection.getLatLonBoundsBox(getProjectionBounds()); 456 477 } 478 479 /** 480 * Gets this rectangle on the screen. 481 * @return The rectangle. 482 * @since 10651 483 */ 484 public Rectangle2D getInView() { 485 double x1 = p1.getInViewX(); 486 double y1 = p1.getInViewY(); 487 double x2 = p2.getInViewX(); 488 double y2 = p2.getInViewY(); 489 return new Rectangle2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x1 - x2), Math.abs(y1 - y2)); 490 } 457 491 } 458 492 -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r10634 r10651 13 13 import java.awt.Image; 14 14 import java.awt.Point; 15 import java.awt.Rectangle;16 15 import java.awt.Toolkit; 17 16 import java.awt.event.ActionEvent; 18 17 import java.awt.event.MouseAdapter; 19 18 import java.awt.event.MouseEvent; 19 import java.awt.geom.Point2D; 20 import java.awt.geom.Rectangle2D; 20 21 import java.awt.image.BufferedImage; 21 22 import java.awt.image.ImageObserver; … … 37 38 import java.util.concurrent.ConcurrentSkipListSet; 38 39 import java.util.concurrent.atomic.AtomicInteger; 40 import java.util.stream.Stream; 39 41 40 42 import javax.swing.AbstractAction; … … 68 70 import org.openstreetmap.josm.actions.SaveActionBase; 69 71 import org.openstreetmap.josm.data.Bounds; 72 import org.openstreetmap.josm.data.ProjectionBounds; 70 73 import org.openstreetmap.josm.data.coor.EastNorth; 71 74 import org.openstreetmap.josm.data.coor.LatLon; … … 78 81 import org.openstreetmap.josm.gui.MapFrame; 79 82 import org.openstreetmap.josm.gui.MapView; 83 import org.openstreetmap.josm.gui.MapViewState.MapViewRectangle; 80 84 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener; 81 85 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 83 87 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; 84 88 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings.FilterChangeListener; 89 import org.openstreetmap.josm.gui.layer.imagery.TileCoordinateConverter; 85 90 import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings; 86 91 import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings.DisplaySettingsChangeEvent; … … 170 175 171 176 private final ImageryAdjustAction adjustAction = new ImageryAdjustAction(this); 177 // prepared to be moved to the painter 178 private TileCoordinateConverter coordinateConverter; 172 179 173 180 /** … … 224 231 225 232 protected void initTileSource(T tileSource) { 233 coordinateConverter = new TileCoordinateConverter(Main.map.mapView, getDisplaySettings()); 226 234 attribution.initialize(tileSource); 227 235 … … 421 429 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Tile Info"), new String[]{tr("OK")}); 422 430 JPanel panel = new JPanel(new GridBagLayout()); 423 Rectangle displaySize = tileToRect(clickedTile);431 Rectangle2D displaySize = coordinateConverter.getRectangleForTile(clickedTile); 424 432 String url = ""; 425 433 try { … … 434 442 {"Tile url", url}, 435 443 {"Tile size", getSizeString(clickedTile.getTileSource().getTileSize()) }, 436 {"Tile display size", new StringBuilder().append(displaySize.width).append('x').append(displaySize.height).toString()}, 444 {"Tile display size", new StringBuilder().append(displaySize.getWidth()) 445 .append('x') 446 .append(displaySize.getHeight()).toString()}, 437 447 }; 438 448 … … 1000 1010 private TileSet getVisibleTileSet() { 1001 1011 MapView mv = Main.map.mapView; 1002 EastNorth topLeft = mv.getEastNorth(0, 0);1003 EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight());1004 return new MapWrappingTileSet(topLeft, botRight, currentZoomLevel);1012 MapViewRectangle area = mv.getState().getViewArea(); 1013 ProjectionBounds bounds = area.getProjectionBounds(); 1014 return getTileSet(bounds.getMin(), bounds.getMax(), currentZoomLevel); 1005 1015 } 1006 1016 … … 1057 1067 } 1058 1068 1059 private Rectangle tileToRect(Tile t1) {1060 /*1061 * We need to get a box in which to draw, so advance by one tile in1062 * each direction to find the other corner of the box.1063 * Note: this somewhat pollutes the tile cache1064 */1065 Tile t2 = tempCornerTile(t1);1066 Rectangle rect = new Rectangle(pixelPos(t1));1067 rect.add(pixelPos(t2));1068 return rect;1069 }1070 1071 1069 // 'source' is the pixel coordinates for the area that 1072 1070 // the img is capable of filling in. However, we probably … … 1075 1073 // 'border' is the screen cordinates that need to be drawn. 1076 1074 // We must not draw outside of it. 1077 private void drawImageInside(Graphics g, Image sourceImg, Rectangle source, Rectangleborder) {1078 Rectangle target = source;1075 private void drawImageInside(Graphics g, Image sourceImg, Rectangle2D source, Rectangle2D border) { 1076 Rectangle2D target = source; 1079 1077 1080 1078 // If a border is specified, only draw the intersection 1081 1079 // if what we have combined with what we are supposed to draw. 1082 1080 if (border != null) { 1083 target = source. intersection(border);1081 target = source.createIntersection(border); 1084 1082 if (Main.isDebugEnabled()) { 1085 1083 Main.debug("source: " + source + "\nborder: " + border + "\nintersection: " + target); … … 1098 1096 1099 1097 // How many pixels into the 'source' rectangle are we drawing? 1100 int screenXoffset = target.x - source.x;1101 int screenYoffset = target.y - source.y;1098 double screenXoffset = target.getX() - source.getX(); 1099 double screenYoffset = target.getY() - source.getY(); 1102 1100 // And how many pixels into the image itself does that correlate to? 1103 1101 int imgXoffset = (int) (screenXoffset * imageXScaling + 0.5); … … 1112 1110 } 1113 1111 g.drawImage(sourceImg, 1114 target.x, target.y,1115 target.x + target.width, target.y + target.height,1112 (int) target.getX(), (int) target.getY(), 1113 (int) target.getMaxX(), (int) target.getMaxY(), 1116 1114 imgXoffset, imgYoffset, 1117 1115 imgXend, imgYend, … … 1120 1118 // dimm by painting opaque rect... 1121 1119 g.setColor(getFadeColorWithAlpha()); 1122 g.fillRect(target.x, target.y, 1123 target.width, target.height); 1120 ((Graphics2D) g).fill(target); 1124 1121 } 1125 1122 } … … 1136 1133 private List<Tile> paintTileImages(Graphics g, TileSet ts, int zoom, Tile border) { 1137 1134 if (zoom <= 0) return Collections.emptyList(); 1138 Rectangle borderRect = null;1135 Rectangle2D borderRect = null; 1139 1136 if (border != null) { 1140 borderRect = tileToRect(border);1137 borderRect = coordinateConverter.getRectangleForTile(border); 1141 1138 } 1142 1139 List<Tile> missedTiles = new LinkedList<>(); … … 1158 1155 img = applyImageProcessors((BufferedImage) img); 1159 1156 1160 Rectangle sourceRect = tileToRect(tile);1157 Rectangle2D sourceRect = coordinateConverter.getRectangleForTile(tile); 1161 1158 if (borderRect != null && !sourceRect.intersects(borderRect)) { 1162 1159 continue; … … 1195 1192 1196 1193 private void paintTileText(TileSet ts, Tile tile, Graphics g, MapView mv, int zoom, Tile t) { 1194 if (tile == null) { 1195 return; 1196 } 1197 Point2D p = coordinateConverter.getPixelForTile(t); 1197 1198 int fontHeight = g.getFontMetrics().getHeight(); 1198 if (tile == null) 1199 return; 1200 Point p = pixelPos(t); 1201 int texty = p.y + 2 + fontHeight; 1199 int x = (int) p.getX(); 1200 int y = (int) p.getY(); 1201 int texty = y + 2 + fontHeight; 1202 1202 1203 1203 /*if (PROP_DRAW_DEBUG.get()) { … … 1217 1217 1218 1218 if (tile.hasError() && getDisplaySettings().isShowErrors()) { 1219 myDrawString(g, tr("Error") + ": " + tr(tile.getErrorMessage()), p.x + 2, texty);1219 myDrawString(g, tr("Error") + ": " + tr(tile.getErrorMessage()), x + 2, texty); 1220 1220 //texty += 1 + fontHeight; 1221 1221 } … … 1226 1226 if (yCursor < t.getYtile()) { 1227 1227 if (t.getYtile() % 32 == 31) { 1228 g.fillRect(0, p.y - 1, mv.getWidth(), 3);1228 g.fillRect(0, y - 1, mv.getWidth(), 3); 1229 1229 } else { 1230 g.drawLine(0, p.y, mv.getWidth(), p.y);1230 g.drawLine(0, y, mv.getWidth(), y); 1231 1231 } 1232 1232 //yCursor = t.getYtile(); … … 1236 1236 if (t.getXtile() % 32 == 0) { 1237 1237 // level 7 tile boundary 1238 g.fillRect( p.x - 1, 0, 3, mv.getHeight());1238 g.fillRect(x - 1, 0, 3, mv.getHeight()); 1239 1239 } else { 1240 g.drawLine( p.x, 0, p.x, mv.getHeight());1240 g.drawLine(x, 0, x, mv.getHeight()); 1241 1241 } 1242 1242 //xCursor = t.getXtile(); 1243 1243 } 1244 1244 } 1245 }1246 1247 private Point pixelPos(LatLon ll) {1248 return Main.map.mapView.getPoint(Main.getProjection().latlon2eastNorth(ll).add(getDx(), getDy()));1249 }1250 1251 private Point pixelPos(Tile t) {1252 ICoordinate coord = tileSource.tileXYToLatLon(t);1253 return pixelPos(new LatLon(coord));1254 1245 } 1255 1246 … … 1269 1260 private final TileSet nullTileSet = new TileSet(); 1270 1261 1271 private final class MapWrappingTileSet extends TileSet { 1272 private MapWrappingTileSet(EastNorth topLeft, EastNorth botRight, int zoom) { 1273 this(getShiftedLatLon(topLeft), getShiftedLatLon(botRight), zoom); 1274 } 1275 1276 private MapWrappingTileSet(LatLon topLeft, LatLon botRight, int zoom) { 1277 super(topLeft, botRight, zoom); 1278 double centerLon = getShiftedLatLon(Main.map.mapView.getCenter()).lon(); 1279 1280 if (topLeft.lon() > centerLon) { 1281 x0 = tileSource.getTileXMin(zoom); 1282 } 1283 if (botRight.lon() < centerLon) { 1284 x1 = tileSource.getTileXMax(zoom); 1285 } 1262 /** 1263 * This is a rectangular range of tiles. 1264 */ 1265 private static class TileRange { 1266 int minX, maxX, minY, maxY; 1267 int zoom; 1268 1269 private TileRange() { 1270 } 1271 1272 protected TileRange(TileXY t1, TileXY t2, int zoom) { 1273 minX = (int) Math.floor(Math.min(t1.getX(), t2.getX())); 1274 minY = (int) Math.floor(Math.min(t1.getY(), t2.getY())); 1275 maxX = (int) Math.ceil(Math.max(t1.getX(), t2.getX())); 1276 maxY = (int) Math.ceil(Math.max(t1.getY(), t2.getY())); 1277 this.zoom = zoom; 1278 } 1279 1280 protected double tilesSpanned() { 1281 return Math.sqrt(1.0 * this.size()); 1282 } 1283 1284 protected int size() { 1285 int xSpan = maxX - minX + 1; 1286 int ySpan = maxY - minY + 1; 1287 return xSpan * ySpan; 1288 } 1289 } 1290 1291 private class TileSet extends TileRange { 1292 1293 protected TileSet(TileXY t1, TileXY t2, int zoom) { 1294 super(t1, t2, zoom); 1286 1295 sanitize(); 1287 }1288 }1289 1290 private class TileSet {1291 int x0, x1, y0, y1;1292 int zoom;1293 1294 /**1295 * Create a TileSet by EastNorth bbox taking a layer shift in account1296 * @param topLeft top-left lat/lon1297 * @param botRight bottom-right lat/lon1298 * @param zoom zoom level1299 */1300 protected TileSet(EastNorth topLeft, EastNorth botRight, int zoom) {1301 this(getShiftedLatLon(topLeft), getShiftedLatLon(botRight), zoom);1302 }1303 1304 /**1305 * Create a TileSet by known LatLon bbox without layer shift correction1306 * @param topLeft top-left lat/lon1307 * @param botRight bottom-right lat/lon1308 * @param zoom zoom level1309 */1310 protected TileSet(LatLon topLeft, LatLon botRight, int zoom) {1311 this.zoom = zoom;1312 if (zoom == 0)1313 return;1314 1315 TileXY t1 = tileSource.latLonToTileXY(topLeft.toCoordinate(), zoom);1316 TileXY t2 = tileSource.latLonToTileXY(botRight.toCoordinate(), zoom);1317 1318 x0 = (int) Math.floor(t1.getX());1319 y0 = (int) Math.floor(t1.getY());1320 x1 = (int) Math.ceil(t2.getX());1321 y1 = (int) Math.ceil(t2.getY());1322 sanitize();1323 1324 1296 } 1325 1297 … … 1332 1304 1333 1305 protected void sanitize() { 1334 if (x0 > x1) { 1335 int tmp = x0; 1336 x0 = x1; 1337 x1 = tmp; 1338 } 1339 if (y0 > y1) { 1340 int tmp = y0; 1341 y0 = y1; 1342 y1 = tmp; 1343 } 1344 1345 if (x0 < tileSource.getTileXMin(zoom)) { 1346 x0 = tileSource.getTileXMin(zoom); 1347 } 1348 if (y0 < tileSource.getTileYMin(zoom)) { 1349 y0 = tileSource.getTileYMin(zoom); 1350 } 1351 if (x1 > tileSource.getTileXMax(zoom)) { 1352 x1 = tileSource.getTileXMax(zoom); 1353 } 1354 if (y1 > tileSource.getTileYMax(zoom)) { 1355 y1 = tileSource.getTileYMax(zoom); 1306 if (minX < tileSource.getTileXMin(zoom)) { 1307 minX = tileSource.getTileXMin(zoom); 1308 } 1309 if (minY < tileSource.getTileYMin(zoom)) { 1310 minY = tileSource.getTileYMin(zoom); 1311 } 1312 if (maxX > tileSource.getTileXMax(zoom)) { 1313 maxX = tileSource.getTileXMax(zoom); 1314 } 1315 if (maxY > tileSource.getTileYMax(zoom)) { 1316 maxY = tileSource.getTileYMax(zoom); 1356 1317 } 1357 1318 } … … 1367 1328 private boolean insane() { 1368 1329 return tileCache == null || size() > tileCache.getCacheSize(); 1369 }1370 1371 private double tilesSpanned() {1372 return Math.sqrt(1.0 * this.size());1373 }1374 1375 private int size() {1376 int xSpan = x1 - x0 + 1;1377 int ySpan = y1 - y0 + 1;1378 return xSpan * ySpan;1379 1330 } 1380 1331 … … 1396 1347 return Collections.emptyList(); 1397 1348 List<Tile> ret = new ArrayList<>(); 1398 for (int x = x0; x <= x1; x++) {1399 for (int y = y0; y <= y1; y++) {1349 for (int x = minX; x <= maxX; x++) { 1350 for (int y = minY; y <= maxY; y++) { 1400 1351 Tile t; 1401 1352 if (create) { … … 1425 1376 */ 1426 1377 private Comparator<Tile> getTileDistanceComparator() { 1427 final int centerX = (int) Math.ceil(( x0 + x1) / 2d);1428 final int centerY = (int) Math.ceil(( y0 + y1) / 2d);1378 final int centerX = (int) Math.ceil((minX + maxX) / 2d); 1379 final int centerY = (int) Math.ceil((minY + maxY) / 2d); 1429 1380 return new Comparator<Tile>() { 1430 1381 private int getDistance(Tile t) { … … 1463 1414 @Override 1464 1415 public String toString() { 1465 return getClass().getName() + ": zoom: " + zoom + " X(" + x0 + ", " + x1 + ") Y(" + y0 + ", " + y1 + ") size: " + size(); 1466 } 1416 return getClass().getName() + ": zoom: " + zoom + " X(" + minX + ", " + maxX + ") Y(" + minY + ", " + maxY + ") size: " + size(); 1417 } 1418 } 1419 1420 /** 1421 * Create a TileSet by EastNorth bbox taking a layer shift in account 1422 * @param topLeft top-left lat/lon 1423 * @param botRight bottom-right lat/lon 1424 * @param zoom zoom level 1425 * @return the tile set 1426 * @since 10651 1427 */ 1428 protected TileSet getTileSet(EastNorth topLeft, EastNorth botRight, int zoom) { 1429 return getTileSet(getShiftedLatLon(topLeft), getShiftedLatLon(botRight), zoom); 1430 } 1431 1432 /** 1433 * Create a TileSet by known LatLon bbox without layer shift correction 1434 * @param topLeft top-left lat/lon 1435 * @param botRight bottom-right lat/lon 1436 * @param zoom zoom level 1437 * @return the tile set 1438 * @since 10651 1439 */ 1440 protected TileSet getTileSet(LatLon topLeft, LatLon botRight, int zoom) { 1441 if (zoom == 0) 1442 return new TileSet(); 1443 1444 TileXY t1 = tileSource.latLonToTileXY(topLeft.toCoordinate(), zoom); 1445 TileXY t2 = tileSource.latLonToTileXY(botRight.toCoordinate(), zoom); 1446 return new TileSet(t1, t2, zoom); 1467 1447 } 1468 1448 … … 1494 1474 1495 1475 private class DeepTileSet { 1496 private final EastNorth topLeft, botRight;1476 private final ProjectionBounds bounds; 1497 1477 private final int minZoom, maxZoom; 1498 1478 private final TileSet[] tileSets; … … 1500 1480 1501 1481 @SuppressWarnings("unchecked") 1502 DeepTileSet(EastNorth topLeft, EastNorth botRight, int minZoom, int maxZoom) { 1503 this.topLeft = topLeft; 1504 this.botRight = botRight; 1482 DeepTileSet(ProjectionBounds bounds, int minZoom, int maxZoom) { 1483 this.bounds = bounds; 1505 1484 this.minZoom = minZoom; 1506 1485 this.maxZoom = maxZoom; … … 1515 1494 TileSet ts = tileSets[zoom-minZoom]; 1516 1495 if (ts == null) { 1517 ts = new MapWrappingTileSet(topLeft, botRight, zoom);1496 ts = AbstractTileSourceLayer.this.getTileSet(bounds.getMin(), bounds.getMax(), zoom); 1518 1497 tileSets[zoom-minZoom] = ts; 1519 1498 } … … 1538 1517 @Override 1539 1518 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 1540 EastNorth topLeft = mv.getEastNorth(0, 0); 1541 EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight()); 1542 1543 if (botRight.east() == 0 || botRight.north() == 0) { 1544 /*Main.debug("still initializing??");*/ 1545 // probably still initializing 1546 return; 1547 } 1519 ProjectionBounds pb = mv.getState().getViewArea().getProjectionBounds(); 1548 1520 1549 1521 needRedraw = false; … … 1554 1526 } 1555 1527 1556 DeepTileSet dts = new DeepTileSet( topLeft, botRight, getMinZoomLvl(), zoom);1528 DeepTileSet dts = new DeepTileSet(pb, getMinZoomLvl(), zoom); 1557 1529 TileSet ts = dts.getTileSet(zoom); 1558 1530 … … 1633 1605 } 1634 1606 Tile t2 = tempCornerTile(missed); 1635 TileSet ts2 = newTileSet(1607 TileSet ts2 = getTileSet( 1636 1608 getShiftedLatLon(tileSource.tileXYToLatLon(missed)), 1637 1609 getShiftedLatLon(tileSource.tileXYToLatLon(t2)), … … 1661 1633 } 1662 1634 1663 attribution.paintAttribution(g, mv.getWidth(), mv.getHeight(), getShiftedCoord(topLeft), getShiftedCoord(botRight), 1635 EastNorth min = pb.getMin(); 1636 EastNorth max = pb.getMax(); 1637 attribution.paintAttribution(g, mv.getWidth(), mv.getHeight(), getShiftedCoord(min), getShiftedCoord(max), 1664 1638 displayZoomLevel, this); 1665 1639 … … 1711 1685 EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight()); 1712 1686 int z = currentZoomLevel; 1713 TileSet ts = newTileSet(topLeft, botRight, z);1687 TileSet ts = getTileSet(topLeft, botRight, z); 1714 1688 1715 1689 if (!ts.tooLarge()) { 1716 1690 ts.loadAllTiles(false); // make sure there are tile objects for all tiles 1717 1691 } 1718 Tile clickedTile = null; 1719 for (Tile t1 : ts.allExistingTiles()) { 1720 Tile t2 = tempCornerTile(t1); 1721 Rectangle r = new Rectangle(pixelPos(t1)); 1722 r.add(pixelPos(t2)); 1723 if (Main.isDebugEnabled()) { 1724 Main.debug("r: " + r + " clicked: " + clicked); 1725 } 1726 if (!r.contains(clicked)) { 1727 continue; 1728 } 1729 clickedTile = t1; 1730 break; 1731 } 1732 if (clickedTile == null) 1733 return null; 1692 Stream<Tile> clickedTiles = ts.allExistingTiles().stream() 1693 .filter(t -> coordinateConverter.getRectangleForTile(t).contains(clicked)); 1734 1694 if (Main.isTraceEnabled()) { 1735 Main.trace("Clicked on tile: " + clickedTile.getXtile() + ' ' + clickedTile.getYtile() +1736 " currentZoomLevel: " + currentZoomLevel);1737 } 1738 return clickedTile ;1695 clickedTiles = clickedTiles.peek(t -> Main.trace("Clicked on tile: " + t.getXtile() + ' ' + t.getYtile() + 1696 " currentZoomLevel: " + currentZoomLevel)); 1697 } 1698 return clickedTiles.findAny().orElse(null); 1739 1699 } 1740 1700
Note:
See TracChangeset
for help on using the changeset viewer.