mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher] In text view, clean how exception (nullptr) are handled
Change-Id: Ibd1c3939c910a3da741bb92f8b341e02cf0bb63c
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user