When used for zooming, check area below current coordinates (x,y) * and return the tile of the zoomed out/in position (zoom_x, zoom_y) * when you just want the tile, make x = zoom_x and y = zoom_y */
| 443 | * and return the tile of the zoomed out/in position (zoom_x, zoom_y) |
| 444 | * when you just want the tile, make x = zoom_x and y = zoom_y */ |
| 445 | static Point GetTileFromScreenXY(int x, int y, int zoom_x, int zoom_y) |
| 446 | { |
| 447 | if (Window *w = FindWindowFromPt(x, y); w != nullptr) { |
| 448 | if (Viewport *vp = IsPtInWindowViewport(w, x, y); vp != nullptr) { |
| 449 | return TranslateXYToTileCoord(*vp, zoom_x, zoom_y); |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | return {-1, -1}; |
| 454 | } |
| 455 | |
| 456 | Point GetTileBelowCursor() |
| 457 | { |
no test coverage detected