Decompile fn_11353 (UIComboBoxEx2::Paint)

Batch #15467 by youko: 0 byte-identical, 1 confirmed by peer review.

- fn_11353 UIComboBoxEx2::Paint: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, Yommy, alisonrag
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-10 01:21:51 +00:00
commit 4e5d174f53

View file

@ -331,16 +331,28 @@ void UIComboBoxEx2::Resize(int width, int height) {
void UIComboBoxEx2::Paint() {
this->ClearSurface(0xC59582u);
this->FillRegion(1, 1, (this->geometry.width - 2), (this->geometry.height - 2), 0xFCF4F0u);
const unsigned end = std::min(
static_cast<unsigned>(this->lines.size()), static_cast<unsigned>((this->topLine + (this->geometry.height / this->lineHeight - this->bottomMargin)))
);
if (this->selected >= this->topLine && this->selected < static_cast<int>(end)) {
this->FillRegion(3, ((this->lineHeight * (this->selected - this->topLine)) + 1), (this->geometry.width - 6), (this->lineHeight - 2), 0xF8D5C4u);
const int top = this->topLine;
const int end = static_cast<int>(std::min(
static_cast<unsigned>((top + (this->geometry.height / this->lineHeight - this->bottomMargin))), static_cast<unsigned>(this->lines.size())
));
for (int row = top; row < end; ++row) {
if (row == this->selected) {
this->FillRegion(3, ((this->lineHeight * (row - top)) + 1), (this->geometry.width - 6), (this->lineHeight - 2), 0xF8D5C4u);
}
}
if (this->alignment == 0 || this->alignment == 1) {
this->DrawRows(this->alignment == 1);
for (int row = top; row < end; ++row) {
if (this->alignment == 0) {
this->DrawTextAt(3 - this->horizontalOffset, this->lineHeight * (row - top) + 2, this->lines[row].text.c_str(), 0, 0, 12, this->lines[row].color, 0, 0);
} else if (this->alignment == 1) {
const int x = static_cast<int>(
static_cast<float>(this->geometry.width) * 0.5f -
static_cast<float>(this->TextWidth(this->lines[row].text.c_str(), 0, 0, 12, 0, 0)) * 0.5f
);
this->DrawTextAt(x, this->lineHeight * (row - top) + 2, this->lines[row].text.c_str(), 0, 0, 12, this->lines[row].color, 0, 0);
}
}
if (this->parent) {