From dd104b0b1b7ce081339718c192deff3c196217c1 Mon Sep 17 00:00:00 2001 From: Blake Thompson Date: Tue, 9 Jun 2015 11:31:50 -0500 Subject: [PATCH] Updated offset converter to remove large spikes --- include/mapnik/offset_converter.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index b32d8170c..ea0d5f069 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -47,7 +47,7 @@ struct MAPNIK_DECL offset_converter offset_converter(Geometry & geom) : geom_(geom) , offset_(0.0) - , threshold_(5.0) + , threshold_(8.0) , half_turn_segments_(16) , status_(initial) , pre_first_(vertex2d::no_init) @@ -266,6 +266,14 @@ private: double sa = offset_ * std::sin(a); double ca = offset_ * std::cos(a); double h = std::tan(0.5 * (b - a)); + if (h > 3.0) + { + h = 3.0; + } + else if (h < -3.0) + { + h = -3.0; + } v.x = v.x + sa + h * ca; v.y = v.y - ca + h * sa; }