summaryrefslogtreecommitdiff
path: root/src/text.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-25 13:45:49 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-25 13:45:49 +0300
commit5184d99bdc319271ee35046640478ab76d3754cc (patch)
treebbca91917664eb202723df93de41d5e9107c51f0 /src/text.cpp
parent5ed1a97e5e9d48169d274230e7dd194dc6310edc (diff)
downloadplus-5184d99bdc319271ee35046640478ab76d3754cc.tar.gz
plus-5184d99bdc319271ee35046640478ab76d3754cc.tar.bz2
plus-5184d99bdc319271ee35046640478ab76d3754cc.tar.xz
plus-5184d99bdc319271ee35046640478ab76d3754cc.zip
add missing checks.
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/text.cpp b/src/text.cpp
index 887c66407..ee9e3b33a 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -46,8 +46,8 @@ Text::Text(const std::string &text, const int x, const int y,
mFont(font ? font : (gui ? gui->getFont() : nullptr)),
mX(x),
mY(y),
- mWidth(mFont->getWidth(text)),
- mHeight(mFont->getHeight()),
+ mWidth(mFont ? mFont->getWidth(text) : 1),
+ mHeight(mFont ? mFont->getHeight() : 1),
mXOffset(0),
mText(text),
mColor(color),