diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-29 07:54:00 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-29 10:40:58 -0600 |
commit | 588148553eb41672147fb98d0e7ad558a8c2884c (patch) | |
tree | 09d5b39c6f3f025f4aa421d8de0c141e54c111e0 /src | |
parent | 5d206f2cd27d9908fe27c3c84c866747eedce7dd (diff) | |
download | mana-588148553eb41672147fb98d0e7ad558a8c2884c.tar.gz mana-588148553eb41672147fb98d0e7ad558a8c2884c.tar.bz2 mana-588148553eb41672147fb98d0e7ad558a8c2884c.tar.xz mana-588148553eb41672147fb98d0e7ad558a8c2884c.zip |
Fix ListBox::draw to work more correctly
Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/listbox.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index eed6b8d0..ef591023 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -63,17 +63,17 @@ void ListBox::draw(gcn::Graphics *graphics) (int) (mAlpha * 255.0f))); graphics->setFont(getFont()); - const int fontHeight = getFont()->getHeight(); + const int height = getRowHeight(); // Draw filled rectangle around the selected list element if (mSelected >= 0) - graphics->fillRectangle(gcn::Rectangle(0, fontHeight * mSelected, - getWidth(), fontHeight)); + graphics->fillRectangle(gcn::Rectangle(0, height * mSelected, + getWidth(), height)); // Draw the list elements graphics->setColor(Theme::getThemeColor(Theme::TEXT)); for (int i = 0, y = 0; i < mListModel->getNumberOfElements(); - ++i, y += fontHeight) + ++i, y += height) { graphics->drawText(mListModel->getElementAt(i), 1, y); } |