From b75e65ced8a059b3a76914a4acece013d4296ff0 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 11 Nov 2026 23:46:55 +0000 Subject: [PATCH] Decompile fn_11553 (UIListBoxEx::SendMsg) Batch #17502 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_11553 UIListBoxEx::SendMsg: logic confirmed by peer review Peer-reviewed-by: eAthena, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Lists/UIListBoxEx.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Source/UI/Lists/UIListBoxEx.cpp b/Source/UI/Lists/UIListBoxEx.cpp index 823883c05..3b8d4659d 100644 --- a/Source/UI/Lists/UIListBoxEx.cpp +++ b/Source/UI/Lists/UIListBoxEx.cpp @@ -237,18 +237,19 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->topLine; - const int visible = this->geometry.height / this->lineHeight; - const int delta = message == UM_SCROLLVERTPAGEUP ? (1 - visible) : message == UM_SCROLLVERTPAGEDOWN ? (visible - 1) : value; - this->topLine = previous + delta; + if (message == UM_SCROLLVERTPAGEUP) { + this->topLine = previous - this->geometry.height / this->lineHeight + 1; + } else if (message == UM_SCROLLVERTPAGEDOWN) { + this->topLine = previous - 1 + this->geometry.height / this->lineHeight; + } else { + this->topLine = previous + value; + } if (this->topLine < 0) { this->topLine = 0; } - - const int maximum = ((static_cast(this->lines.size()) - visible) + this->bottomMargin); - - if (static_cast(this->topLine) > static_cast(maximum)) { - this->topLine = maximum; + if (this->topLine > this->lines.size() - this->geometry.height / this->lineHeight + this->bottomMargin) { + this->topLine = this->lines.size() - this->geometry.height / this->lineHeight + this->bottomMargin; } this->verticalBar->position = this->topLine;