mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 19:49:58 +02:00
[kandinsky] Replace KDText::stringSize(" ") by KDText::charSize()
Change-Id: Ie962d7784b54ff41431d21f64d9af0887a86f9b7
This commit is contained in:
@@ -7,8 +7,12 @@ KDSize KDText::stringSize(const char * text, FontSize size) {
|
||||
if (text == nullptr) {
|
||||
return KDSizeZero;
|
||||
}
|
||||
if (size == FontSize::Large) {
|
||||
return KDSize(BITMAP_LargeFont_CHARACTER_WIDTH*strlen(text), BITMAP_LargeFont_CHARACTER_HEIGHT);
|
||||
}
|
||||
return KDSize(BITMAP_SmallFont_CHARACTER_WIDTH*strlen(text), BITMAP_SmallFont_CHARACTER_HEIGHT);
|
||||
KDSize cSize = charSize(size);
|
||||
return KDSize(cSize.width()*strlen(text), cSize.height());
|
||||
}
|
||||
|
||||
KDSize KDText::charSize(FontSize size) {
|
||||
if (size == FontSize::Large) {
|
||||
return KDSize(BITMAP_LargeFont_CHARACTER_WIDTH, BITMAP_LargeFont_CHARACTER_HEIGHT);
|
||||
}
|
||||
return KDSize(BITMAP_SmallFont_CHARACTER_WIDTH, BITMAP_SmallFont_CHARACTER_HEIGHT);}
|
||||
|
||||
Reference in New Issue
Block a user