* Is a xy position inside the viewport of the window? * @param w Window to examine its viewport * @param x X coordinate of the xy position * @param y Y coordinate of the xy position * @return Pointer to the viewport if the xy position is in the viewport of the window, * otherwise \c nullptr is returned. */
| 406 | * otherwise \c nullptr is returned. |
| 407 | */ |
| 408 | Viewport *IsPtInWindowViewport(const Window *w, int x, int y) |
| 409 | { |
| 410 | if (w->viewport == nullptr) return nullptr; |
| 411 | |
| 412 | const Viewport &vp = *w->viewport; |
| 413 | if (IsInsideMM(x, vp.left, vp.left + vp.width) && IsInsideMM(y, vp.top, vp.top + vp.height)) return w->viewport.get(); |
| 414 | |
| 415 | return nullptr; |
| 416 | } |
| 417 | |
| 418 | /** |
| 419 | * Translate screen coordinate in a viewport to underlying tile coordinate. |
no test coverage detected