[escher] Avoid using floats to compute ints.

Change-Id: I5637194badc75eec6f016f44bb9660b51d2157b9
This commit is contained in:
Léa Saviot
2018-04-19 16:42:03 +02:00
parent b90dea7cee
commit 56b2b505cd
3 changed files with 3 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ void StackView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(KDRect(0, height-1, width, 1), m_separatorColor);
// Write title
KDSize textSize = KDText::stringSize(m_controller->title(), KDText::FontSize::Small);
KDPoint origin(0.5f*(m_frame.width() - textSize.width()),0.5f*(m_frame.height() - textSize.height()));
KDPoint origin((m_frame.width() - textSize.width())/2,(m_frame.height() - textSize.height())/2);
ctx->drawString(m_controller->title(), origin, KDText::FontSize::Small, m_textColor, m_backgroundColor);
}