From 34da94ffc8e3b4faa1e455151abeb7bf1dfa311b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 11 May 2024 20:51:44 +0100 Subject: [PATCH] Fix: Use widget resize step instead of window resize step. (#12659) Build Picker class list filter could be drawn incorrectly depending on how the window can be resized. --- src/picker_gui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/picker_gui.cpp b/src/picker_gui.cpp index f1fd6f661b..4cb2f16c55 100644 --- a/src/picker_gui.cpp +++ b/src/picker_gui.cpp @@ -275,10 +275,11 @@ void PickerWindow::DrawWidget(const Rect &r, WidgetID widget) const Rect ir = r.Shrink(WidgetDimensions::scaled.matrix); const int selected = this->callbacks.GetSelectedClass(); const auto vscroll = this->GetScrollbar(WID_PW_CLASS_SCROLL); + const int y_step = this->GetWidget(widget)->resize_y; auto [first, last] = vscroll->GetVisibleRangeIterators(this->classes); for (auto it = first; it != last; ++it) { DrawString(ir, this->callbacks.GetClassName(*it), *it == selected ? TC_WHITE : TC_BLACK); - ir.top += this->resize.step_height; + ir.top += y_step; } break; }