fix #2975 - remove usage of boost/algorithm/clamp.hpp

This commit is contained in:
Dane Springmeyer 2015-07-14 19:19:39 -07:00
parent 8a9b46edfd
commit 2b8abc4bfa

View file

@ -31,8 +31,7 @@
#include <mapnik/util/variant.hpp> #include <mapnik/util/variant.hpp>
// agg // agg
#include <agg_trans_affine.h> #include <agg_trans_affine.h>
// boost
#include <boost/algorithm/clamp.hpp>
// stl // stl
#include <cmath> #include <cmath>
@ -154,14 +153,18 @@ struct transform_processor
void operator() (skewX_node const& node) void operator() (skewX_node const& node)
{ {
auto degrees = std::fmod(eval(node.angle_),90.0); auto degrees = std::fmod(eval(node.angle_),90.0);
auto angle = deg2rad(boost::algorithm::clamp(degrees, -89.0, 89.0)); if (degrees < -89.0) degrees = -89.0;
else if (degrees > 89.0) degrees = 89.0;
auto angle = deg2rad(degrees);
transform_.multiply(agg::trans_affine_skewing(angle, 0.0)); transform_.multiply(agg::trans_affine_skewing(angle, 0.0));
} }
void operator() (skewY_node const& node) void operator() (skewY_node const& node)
{ {
auto degrees = std::fmod(eval(node.angle_),90.0); auto degrees = std::fmod(eval(node.angle_),90.0);
auto angle = deg2rad(boost::algorithm::clamp(degrees, -89.0, 89.0)); if (degrees < -89.0) degrees = -89.0;
else if (degrees > 89.0) degrees = 89.0;
auto angle = deg2rad(degrees);
transform_.multiply(agg::trans_affine_skewing(0.0, angle)); transform_.multiply(agg::trans_affine_skewing(0.0, angle));
} }