* * rct2: 0x006EE6EA */
| 278 | * rct2: 0x006EE6EA |
| 279 | */ |
| 280 | void WindowPushOthersBelow(WindowBase& w1) |
| 281 | { |
| 282 | // Enumerate through all other windows |
| 283 | WindowVisitEach([&w1](WindowBase* w2) { |
| 284 | if (&w1 == w2) |
| 285 | return; |
| 286 | // ? |
| 287 | if (w2->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront)) |
| 288 | return; |
| 289 | // Check if w2 intersects with w1 |
| 290 | if (w2->windowPos.x > (w1.windowPos.x + w1.width) || w2->windowPos.x + w2->width < w1.windowPos.x) |
| 291 | return; |
| 292 | if (w2->windowPos.y > (w1.windowPos.y + w1.height) || w2->windowPos.y + w2->height < w1.windowPos.y) |
| 293 | return; |
| 294 | |
| 295 | // Check if there is room to push it down |
| 296 | if (w1.windowPos.y + w1.height + 80 >= ContextGetHeight()) |
| 297 | return; |
| 298 | |
| 299 | // Invalidate the window's current area |
| 300 | w2->invalidate(); |
| 301 | |
| 302 | int32_t push_amount = w1.windowPos.y + w1.height - w2->windowPos.y + 3; |
| 303 | w2->windowPos.y += push_amount; |
| 304 | |
| 305 | // Invalidate the window's new area |
| 306 | w2->invalidate(); |
| 307 | |
| 308 | // Update viewport position if necessary |
| 309 | if (w2->viewport != nullptr) |
| 310 | w2->viewport->pos.y += push_amount; |
| 311 | }); |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * |
no test coverage detected