From 97e33ec8ca6855245177299030f5156e117c187b Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Wed, 22 Jan 2020 10:45:15 +0000 Subject: [PATCH] Move 0.5 up/down rounding into rounding expression (via @lightmare https://github.com/mapnik/mapnik/pull/4113/commits/7f54e947485df0a35e0dab9b5aacea8db2cff88c#r369294323) (ref #4116) --- utils/svg2png/svg2png.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/svg2png/svg2png.cpp b/utils/svg2png/svg2png.cpp index ab2ddab7b..fde92da36 100644 --- a/utils/svg2png/svg2png.cpp +++ b/utils/svg2png/svg2png.cpp @@ -75,11 +75,11 @@ struct main_marker_visitor std::tie(w, h) = marker.dimensions(); - double svg_width = w * scale_factor_ + 0.5; - double svg_height = h * scale_factor_ + 0.5; + double svg_width = w * scale_factor_; + double svg_height = h * scale_factor_; - int output_width = static_cast(svg_width); - int output_height = static_cast(svg_height); + int output_width = static_cast(svg_width + 0.5); + int output_height = static_cast(svg_height + 0.5); if (verbose_) { std::clog << "Found width of '" << w << "' and height of '" << h << "'\n";