From b6c5c57713bf785be0f2d34005fd5eae77bdc6a9 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 30 Apr 2011 00:43:57 +0000 Subject: [PATCH] label_position on lines should take the middle point to preserve previous behavior before move to path type geometries - patch from Ldp - closes #740 and #668 --- AUTHORS | 1 + include/mapnik/geometry.hpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/AUTHORS b/AUTHORS index 6c3b36b7e..d824329cf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -58,6 +58,7 @@ Patches - Philipp Spitzer - Dave Stubbs - River Tarnell + - Lennard voor den Dag - Shaun Walbridge - Leslie Wu diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 0f24a0ebc..abceef28d 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -181,6 +181,12 @@ public: void label_position(double *x, double *y) const { + if (type_ == LineString || type_ == MultiLineString) + { + middle_point(x,y); + return; + } + unsigned size = cont_.size(); if (size < 3) {