diff --git a/escher/src/text_view.cpp b/escher/src/text_view.cpp index 836f5cb67..4ac1b8a1a 100644 --- a/escher/src/text_view.cpp +++ b/escher/src/text_view.cpp @@ -37,11 +37,7 @@ void TextView::setAlignment(float horizontalAlignment, float verticalAlignment) } KDSize TextView::minimalSizeForOptimalDisplay() { - if (m_text == nullptr) { - return KDSizeZero; - } else { - return KDText::stringSize(m_text); - } + return KDText::stringSize(m_text); } void TextView::drawRect(KDContext * ctx, KDRect rect) const { diff --git a/kandinsky/src/text.cpp b/kandinsky/src/text.cpp index 75e03d07e..c7b64b7c9 100644 --- a/kandinsky/src/text.cpp +++ b/kandinsky/src/text.cpp @@ -3,5 +3,8 @@ #include "font.h" KDSize KDText::stringSize(const char * text) { + if (text == nullptr) { + return KDSizeZero; + } return KDSize(BITMAP_FONT_CHARACTER_WIDTH*strlen(text), BITMAP_FONT_CHARACTER_HEIGHT); }