summaryrefslogtreecommitdiff
path: root/src/gui/widgets/label.cpp
diff options
context:
space:
mode:
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")
}