[Kandinsky] Create a KDText class for text measurement

Change-Id: Ie3ecd402b5476f41a2f8694a276f62495fbcdbd1
This commit is contained in:
Romain Goyet
2016-08-19 10:28:43 +02:00
parent d2ff3457b5
commit f93da3b0d8
8 changed files with 22 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ void TextView::setText(const char * text) {
}
void TextView::drawRect(KDContext * ctx, KDRect rect) const {
KDSize textSize = ctx->stringSize(m_text);
KDSize textSize = KDText::stringSize(m_text);
KDPoint origin = {
(KDCoordinate)(m_horizontalAlignment*(m_frame.width() - textSize.width())),
(KDCoordinate)(m_verticalAlignment*(m_frame.height() - textSize.height()))