diff --git a/Source/UI/Enchant/UIEnchantUI.cpp b/Source/UI/Enchant/UIEnchantUI.cpp index 21f15493..e6163395 100644 --- a/Source/UI/Enchant/UIEnchantUI.cpp +++ b/Source/UI/Enchant/UIEnchantUI.cpp @@ -141,9 +141,9 @@ void CUIListBoxEx::AddNe this->items.clear(); this->selected = static_cast(-1); - if (this->rowHeight <= this->geometry.height) { + if (this->geometry.height >= this->rowHeight) { unsigned int count = static_cast(this->geometry.height / this->rowHeight) + 1; - if (this->geometry.height % this->rowHeight > 1) { + if (this->geometry.height % this->rowHeight >= 2) { ++count; } this->items.resize(count); @@ -239,9 +239,9 @@ void CUIListBoxEx::AddNewItem() { this->items.clear(); this->selected = static_cast(-1); - if (this->rowHeight <= this->geometry.height) { + if (this->geometry.height >= this->rowHeight) { unsigned int count = static_cast(this->geometry.height / this->rowHeight) + 1; - if (this->geometry.height % this->rowHeight > 1) { + if (this->geometry.height % this->rowHeight >= 2) { ++count; } this->items.resize(count);