From 0a15a955a2e982b5d789a2a93d864dc8fa8e61c3 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 6 Nov 2017 12:36:47 +0100 Subject: [PATCH] SVG parser - fix default gradient vector in linear gradient [0,0,1,0] + support units in `offset` attribute. --- src/svg/svg_parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index 20fdba163..4dd3fbcaa 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -1211,7 +1211,8 @@ void parse_gradient_stop(svg_parser & parser, mapnik::gradient& gr, rapidxml::xm auto * attr = node->first_attribute("offset"); if (attr != nullptr) { - offset = parse_double(parser.err_handler(),attr->value()); + bool percent = false; + offset = parse_svg_value(parser.err_handler(),attr->value(), percent); } attr = node->first_attribute("style"); @@ -1378,7 +1379,7 @@ void parse_linear_gradient(svg_parser & parser, rapidxml::xml_node const* double x1 = 0.0; double x2 = 1.0; double y1 = 0.0; - double y2 = 1.0; + double y2 = 0.0; bool has_percent=true; attr = node->first_attribute("x1");