mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix disabled widgets sharing the same space as active widgets (#20535)
* Fix disabled widgets sharing the same space as active widgets * Add PR for reference in comment Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
This commit is contained in:
parent
62914a39fb
commit
0b9639eb25
|
@ -805,13 +805,20 @@ void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_ta
|
||||||
|
|
||||||
for (i = start_tab_id; i <= end_tab_id; i++)
|
for (i = start_tab_id; i <= end_tab_id; i++)
|
||||||
{
|
{
|
||||||
|
auto& widget = w->widgets[i];
|
||||||
if (!WidgetIsDisabled(*w, i))
|
if (!WidgetIsDisabled(*w, i))
|
||||||
{
|
{
|
||||||
auto& widget = w->widgets[i];
|
|
||||||
widget.left = x;
|
widget.left = x;
|
||||||
widget.right = x + tab_width;
|
widget.right = x + tab_width;
|
||||||
x += tab_width + 1;
|
x += tab_width + 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Workaround #20535: Avoid disabled widgets from sharing the same space as active ones, otherwise
|
||||||
|
// WindowFindWidgetFromPoint could return the disabled one, causing issues.
|
||||||
|
widget.left = 0;
|
||||||
|
widget.right = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue