Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix logic around BlendishComboBox::setCurrentIndex
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Mar 31, 2023
1 parent 3792d80 commit a0aa731
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opengl/Blendish.cpp
Expand Up @@ -1162,10 +1162,10 @@ BlendishMenuItem* BlendishComboBox::getCurrentMenuItem() const noexcept

void BlendishComboBox::setCurrentIndex(int index, const bool triggerCallback)
{
if (index < -1)
if (index <= -1)
index = -1;
else if ((uint)index > menu.items.size())
index = menu.items.size();
else if ((uint)index >= menu.items.size())
index = menu.items.size() - 1;

if (currentIndex == index)
return;
Expand Down

0 comments on commit a0aa731

Please sign in to comment.