diff --git a/utils/svg2png/svg2png.cpp b/utils/svg2png/svg2png.cpp index 269e722ed..e2b07358d 100644 --- a/utils/svg2png/svg2png.cpp +++ b/utils/svg2png/svg2png.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -78,8 +79,8 @@ struct main_marker_visitor double svg_width = w * scale_factor_; double svg_height = h * scale_factor_; - int output_width = static_cast(svg_width + 0.5); - int output_height = static_cast(svg_height + 0.5); + int output_width = static_cast(std::round(svg_width)); + int output_height = static_cast(std::round(svg_height)); if (verbose_) { std::clog << "Found width of '" << w << "' and height of '" << h << "'\n";