| 2472 | } |
| 2473 | |
| 2474 | static void PlaceObject() |
| 2475 | { |
| 2476 | Point pt; |
| 2477 | Window *w; |
| 2478 | |
| 2479 | pt = GetTileBelowCursor(); |
| 2480 | if (pt.x == -1) return; |
| 2481 | |
| 2482 | if ((_thd.place_mode & HT_DRAG_MASK) == HT_POINT) { |
| 2483 | pt.x += TILE_SIZE / 2; |
| 2484 | pt.y += TILE_SIZE / 2; |
| 2485 | } |
| 2486 | |
| 2487 | _tile_fract_coords.x = pt.x & TILE_UNIT_MASK; |
| 2488 | _tile_fract_coords.y = pt.y & TILE_UNIT_MASK; |
| 2489 | |
| 2490 | w = _thd.GetCallbackWnd(); |
| 2491 | if (w != nullptr) w->OnPlaceObject(pt, TileVirtXY(pt.x, pt.y)); |
| 2492 | } |
| 2493 | |
| 2494 | |
| 2495 | bool HandleViewportClicked(const Viewport &vp, int x, int y) |
no test coverage detected