fix(renderer): Round floatig point numbers

Refs #378
This commit is contained in:
Michael Carlberg 2017-01-25 21:46:17 +01:00
parent 8fa879c8d8
commit 886d0f4ff3
1 changed files with 4 additions and 5 deletions

View File

@ -279,10 +279,10 @@ void renderer::end() {
void renderer::flush(alignment a) { void renderer::flush(alignment a) {
m_log.trace_x("renderer: flush(%i)", static_cast<int>(a)); m_log.trace_x("renderer: flush(%i)", static_cast<int>(a));
double x = block_x(a); double x = static_cast<int>(block_x(a) + 0.5);
double y = block_y(a); double y = static_cast<int>(block_y(a) + 0.5);
double w = block_w(a); double w = static_cast<int>(block_w(a) + 0.5);
double h = block_h(a); double h = static_cast<int>(block_h(a) + 0.5);
double xw = x + w; double xw = x + w;
m_surface->flush(); m_surface->flush();
@ -658,7 +658,6 @@ bool renderer::on(const signals::parser::change_alignment& evt) {
m_context->pop(&m_blocks[m_align].pattern); m_context->pop(&m_blocks[m_align].pattern);
} }
// flush(m_align);
m_align = align; m_align = align;
m_blocks[m_align].x = 0.0; m_blocks[m_align].x = 0.0;
m_blocks[m_align].y = 0.0; m_blocks[m_align].y = 0.0;