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).
This commit is contained in:
parent
6264dd7abb
commit
78ec74dde1
1 changed files with 6 additions and 2 deletions
|
|
@ -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<int>(this->lines.size()) - visible));
|
||||
const int overflow = std::ranges::max(static_cast<int>(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<int>(this->lines.size());
|
||||
bar->visible = visible;
|
||||
bar->Invalidate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue