From cc0f174be5018ecbefbcf70dca5a5270a157496a Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 25 Aug 2014 18:06:55 +0200 Subject: [PATCH] Round instead of truncating. --- src/drawableline.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/drawableline.cpp b/src/drawableline.cpp index 006bb06..6639a23 100644 --- a/src/drawableline.cpp +++ b/src/drawableline.cpp @@ -26,6 +26,7 @@ #endif #include #include +#include #if defined(WITH_DEBUG_VISUALS) namespace cloonel { @@ -80,8 +81,8 @@ namespace cloonel { } } - parLine[0] = static_cast(line[0]); - parLine[1] = static_cast(line[1]); + parLine[0] = short2(static_cast(boost::math::iround(line[0].x())), static_cast(boost::math::iround(line[0].y()))); + parLine[1] = short2(static_cast(boost::math::iround(line[1].x())), static_cast(boost::math::iround(line[1].y()))); } } //unnamed namespace