1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Add widget visible flag

This commit is contained in:
Ted John
2021-01-23 12:21:18 +00:00
parent c1a1f8f639
commit be350f7e2e
9 changed files with 99 additions and 27 deletions

View File

@@ -628,11 +628,13 @@ void WindowDrawWidgets(rct_window* w, rct_drawpixelinfo* dpi)
widgetIndex = 0;
for (widget = w->widgets; widget->type != WindowWidgetType::Last; widget++)
{
// Check if widget is outside the draw region
if (w->windowPos.x + widget->left < dpi->x + dpi->width && w->windowPos.x + widget->right >= dpi->x)
if (w->windowPos.y + widget->top < dpi->y + dpi->height && w->windowPos.y + widget->bottom >= dpi->y)
WidgetDraw(dpi, w, widgetIndex);
if (widget->IsVisible())
{
// Check if widget is outside the draw region
if (w->windowPos.x + widget->left < dpi->x + dpi->width && w->windowPos.x + widget->right >= dpi->x)
if (w->windowPos.y + widget->top < dpi->y + dpi->height && w->windowPos.y + widget->bottom >= dpi->y)
WidgetDraw(dpi, w, widgetIndex);
}
widgetIndex++;
}