From 3af3286436f47a341b4ccedfb11c04e8c1d8e4a0 Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Tue, 9 Jan 2018 15:14:24 +0000 Subject: [PATCH] SVG: Add a test of clipPath --- test/unit/svg/svg_parser_test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/unit/svg/svg_parser_test.cpp b/test/unit/svg/svg_parser_test.cpp index 2144b577a..2f957e084 100644 --- a/test/unit/svg/svg_parser_test.cpp +++ b/test/unit/svg/svg_parser_test.cpp @@ -833,4 +833,18 @@ TEST_CASE("SVG parser") { REQUIRE(y2 == 0.10); REQUIRE(r == 0.75); } + + SECTION("SVG ") + { + std::string svg_name("./test/data/svg/clippath.svg"); + std::shared_ptr marker = mapnik::marker_cache::instance().find(svg_name, false); + REQUIRE(marker); + REQUIRE(marker->is()); + mapnik::marker_svg const& svg = mapnik::util::get(*marker); + + // Check whether the clipPath doesn't add to the bounding box. + auto bbox = svg.bounding_box(); + CHECK(bbox.width() == Approx(100)); + CHECK(bbox.height() == Approx(100)); + } }