use std::round (ref:https://en.cppreference.com/w/cpp/numeric/math/round)
This commit is contained in:
parent
53f8c49620
commit
ed194a3c09
1 changed files with 3 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include <mapnik/version.hpp>
|
#include <mapnik/version.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
|
@ -78,8 +79,8 @@ struct main_marker_visitor
|
||||||
double svg_width = w * scale_factor_;
|
double svg_width = w * scale_factor_;
|
||||||
double svg_height = h * scale_factor_;
|
double svg_height = h * scale_factor_;
|
||||||
|
|
||||||
int output_width = static_cast<int>(svg_width + 0.5);
|
int output_width = static_cast<int>(std::round(svg_width));
|
||||||
int output_height = static_cast<int>(svg_height + 0.5);
|
int output_height = static_cast<int>(std::round(svg_height));
|
||||||
if (verbose_)
|
if (verbose_)
|
||||||
{
|
{
|
||||||
std::clog << "Found width of '" << w << "' and height of '" << h << "'\n";
|
std::clog << "Found width of '" << w << "' and height of '" << h << "'\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue