diff --git a/escher/src/expression_view.cpp b/escher/src/expression_view.cpp index dfd23e3b3..a760f635a 100644 --- a/escher/src/expression_view.cpp +++ b/escher/src/expression_view.cpp @@ -49,7 +49,7 @@ KDSize ExpressionView::minimalSizeForOptimalDisplay() const { KDPoint ExpressionView::drawingOrigin() const { KDSize expressionSize = m_expressionLayout->size(); - return KDPoint(m_horizontalAlignment*(m_frame.width() - expressionSize.width()), 0.5f*(m_frame.height() - expressionSize.height())); + return KDPoint(m_horizontalAlignment*(m_frame.width() - expressionSize.width()), (m_frame.height() - expressionSize.height())/2); } KDPoint ExpressionView::absoluteDrawingOrigin() const { diff --git a/escher/src/stack_view.cpp b/escher/src/stack_view.cpp index 5f125bea5..bd667671d 100644 --- a/escher/src/stack_view.cpp +++ b/escher/src/stack_view.cpp @@ -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); } diff --git a/escher/src/tab_view_cell.cpp b/escher/src/tab_view_cell.cpp index 7bea92c38..43be0c1c8 100644 --- a/escher/src/tab_view_cell.cpp +++ b/escher/src/tab_view_cell.cpp @@ -48,7 +48,7 @@ void TabViewCell::drawRect(KDContext * ctx, KDRect rect) const { } // 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, text, background); }