mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-19 10:22:39 +01:00
Fix: Apply widget's internal padding to scrollbar capacity/position. (#12801)
For non-WWT_MATRIX widgets, scrollbars need to take account of the internal padding used for the widget. This is not normally noticeable as framerect padding is only 2 extra pixels
This commit is contained in:
@@ -1836,8 +1836,8 @@ public:
|
||||
|
||||
void OnResize() override
|
||||
{
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_ID_INDUSTRY_LIST);
|
||||
this->hscroll->SetCapacityFromWidget(this, WID_ID_INDUSTRY_LIST);
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_ID_INDUSTRY_LIST, WidgetDimensions::scaled.framerect.Vertical());
|
||||
this->hscroll->SetCapacityFromWidget(this, WID_ID_INDUSTRY_LIST, WidgetDimensions::scaled.framerect.Horizontal());
|
||||
}
|
||||
|
||||
void OnEditboxChanged(WidgetID wid) override
|
||||
@@ -3178,7 +3178,7 @@ struct IndustryCargoesWindow : public Window {
|
||||
|
||||
void OnResize() override
|
||||
{
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_IC_PANEL, WidgetDimensions::scaled.framerect.top + CargoesField::small_height);
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_IC_PANEL, WidgetDimensions::scaled.framerect.Vertical() + CargoesField::small_height);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user