summaryrefslogtreecommitdiff
path: root/src/gui/widgets/extendedlistbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-22 15:55:34 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-22 15:55:34 +0300
commit04f47f060f94ec0e2dfc3cccf62cff167e0ecd68 (patch)
tree206bd9f2fa3ea57c74c143aa06deddf44d6d0bea /src/gui/widgets/extendedlistbox.cpp
parent60ae9c1b34a6fe98dfde22e38ec95e65d7cdcf1c (diff)
downloadmv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.gz
mv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.bz2
mv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.xz
mv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.zip
Reoder some text and image drawing for better batching.
Diffstat (limited to 'src/gui/widgets/extendedlistbox.cpp')
-rw-r--r--src/gui/widgets/extendedlistbox.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index 36bcc365a..afed14481 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -175,22 +175,6 @@ void ExtendedListBox::draw(Graphics *graphics)
}
}
- for (size_t f = 0; f < selSz; ++f)
- {
- const ExtendedListBoxItem &item = mSelectedItems[f];
- const int row1 = item.row;
- if (item.image)
- {
- const Image *const image = model->getImageAt(row1);
- if (image)
- {
- graphics->drawImage(image,
- mImagePadding,
- item.y + (height - image->getHeight()) / 2 + mPadding);
- }
- }
- }
-
graphics->setColorAll(mForegroundSelectedColor, mForegroundSelectedColor2);
for (size_t f = 0; f < selSz; ++f)
@@ -210,6 +194,22 @@ void ExtendedListBox::draw(Graphics *graphics)
}
}
+ for (size_t f = 0; f < selSz; ++f)
+ {
+ const ExtendedListBoxItem &item = mSelectedItems[f];
+ const int row1 = item.row;
+ if (item.image)
+ {
+ const Image *const image = model->getImageAt(row1);
+ if (image)
+ {
+ graphics->drawImage(image,
+ mImagePadding,
+ item.y + (height - image->getHeight()) / 2 + mPadding);
+ }
+ }
+ }
+
BLOCK_END("ExtendedListBox::draw")
}