summaryrefslogtreecommitdiff
path: root/src/gui/widgets/label.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
committerAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
commit1e2a88e975019929c4c7e3154537865cc09550a6 (patch)
treeae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/gui/widgets/label.cpp
parent6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff)
downloadmv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz
mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2
mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz
mv-1e2a88e975019929c4c7e3154537865cc09550a6.zip
Fix some code style issues
Diffstat (limited to 'src/gui/widgets/label.cpp')
-rw-r--r--src/gui/widgets/label.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 193c28ec6..9dfa7ce4d 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -152,7 +152,6 @@ void Label::draw(Graphics *const graphics)
BLOCK_START("Label::draw")
int textX;
const Rect &rect = mDimension;
- const int textY = rect.height / 2 - getFont()->getHeight() / 2;
Font *const font = getFont();
switch (mAlignment)
@@ -185,7 +184,10 @@ void Label::draw(Graphics *const graphics)
const Image *const image = mTextChunk.img;
if (image != nullptr)
+ {
+ const int textY = rect.height / 2 - font->getHeight() / 2;
graphics->drawImage(image, textX, textY);
+ }
BLOCK_END("Label::draw")
}