From 886d0f4ff3ada2de072c999043064e31f734d0b4 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 25 Jan 2017 21:46:17 +0100 Subject: [PATCH] fix(renderer): Round floatig point numbers Refs #378 --- src/components/renderer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/renderer.cpp b/src/components/renderer.cpp index 9a136ac8..e4819f4e 100644 --- a/src/components/renderer.cpp +++ b/src/components/renderer.cpp @@ -279,10 +279,10 @@ void renderer::end() { void renderer::flush(alignment a) { m_log.trace_x("renderer: flush(%i)", static_cast(a)); - double x = block_x(a); - double y = block_y(a); - double w = block_w(a); - double h = block_h(a); + double x = static_cast(block_x(a) + 0.5); + double y = static_cast(block_y(a) + 0.5); + double w = static_cast(block_w(a) + 0.5); + double h = static_cast(block_h(a) + 0.5); double xw = x + w; m_surface->flush(); @@ -658,7 +658,6 @@ bool renderer::on(const signals::parser::change_alignment& evt) { m_context->pop(&m_blocks[m_align].pattern); } - // flush(m_align); m_align = align; m_blocks[m_align].x = 0.0; m_blocks[m_align].y = 0.0;