From 78ec74dde1d587b0e33bcdaa6217e447e59195b4 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 15:47:46 +0000 Subject: [PATCH] Decompile fn_11512 (UIListBox::Refresh) Batch #16221 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_11512 UIListBox::Refresh: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, youko Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Lists/UIListBox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/UI/Lists/UIListBox.cpp b/Source/UI/Lists/UIListBox.cpp index b36347e7a..e184e5b74 100644 --- a/Source/UI/Lists/UIListBox.cpp +++ b/Source/UI/Lists/UIListBox.cpp @@ -252,11 +252,15 @@ void UIListBox::Clear() { // FUNCTION: fn_11512 void UIListBox::Refresh() { const int visible = this->geometry.height / this->lineHeight; - const int overflow = std::max(0, (static_cast(this->lines.size()) - visible)); + const int overflow = std::ranges::max(static_cast(this->lines.size()) - visible, 0); this->verticalOverflow = overflow != 0; UIScrollBar* bar = this->verticalBar; - bar->maximum = overflow != 0 ? (this->bottomMargin + overflow) : 0; + if (overflow != 0) { + bar->maximum = this->bottomMargin + overflow; + } else { + bar->maximum = 0; + } bar->total = static_cast(this->lines.size()); bar->visible = visible; bar->Invalidate();