mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
[escher] Avoid using floats to compute ints.
Change-Id: I5637194badc75eec6f016f44bb9660b51d2157b9
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user