diff --git a/include/mapnik/text/text_properties.hpp b/include/mapnik/text/text_properties.hpp index cd63ae93a..677cd3230 100644 --- a/include/mapnik/text/text_properties.hpp +++ b/include/mapnik/text/text_properties.hpp @@ -96,7 +96,8 @@ enum directions_e : std::uint8_t SOUTHEAST, NORTHWEST, SOUTHWEST, - EXACT_POSITION + EXACT_POSITION, + CENTER }; using fontset_map = std::map; diff --git a/src/text/placements/simple.cpp b/src/text/placements/simple.cpp index 1edb0c19b..24b3af621 100644 --- a/src/text/placements/simple.cpp +++ b/src/text/placements/simple.cpp @@ -57,6 +57,7 @@ struct direction_name : x3::symbols ("NW", NORTHWEST) ("SW", SOUTHWEST) ("X" , EXACT_POSITION) + ("C" , CENTER) ; } } names; diff --git a/src/text/text_layout.cpp b/src/text/text_layout.cpp index 34f77af39..9de48d44f 100644 --- a/src/text/text_layout.cpp +++ b/src/text/text_layout.cpp @@ -79,6 +79,8 @@ pixel_position evaluate_displacement(double dx, double dy, directions_e dir) return pixel_position(-std::abs(dx),-std::abs(dy)); case SOUTHWEST: return pixel_position(-std::abs(dx),std::abs(dy)); + case CENTER: + return pixel_position(0, 0); default: return pixel_position(dx,dy); }