Skip to content

Commit

Permalink
Merge pull request #3826 from mapycz/svg-clippath-test
Browse files Browse the repository at this point in the history
SVG: Add a test of clipPath
  • Loading branch information
artemp committed Jan 9, 2018
2 parents f6b11b8 + 3af3286 commit 2aab39b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/unit/svg/svg_parser_test.cpp
Expand Up @@ -833,4 +833,18 @@ TEST_CASE("SVG parser") {
REQUIRE(y2 == 0.10);
REQUIRE(r == 0.75);
}

SECTION("SVG <clipPath>")
{
std::string svg_name("./test/data/svg/clippath.svg");
std::shared_ptr<mapnik::marker const> marker = mapnik::marker_cache::instance().find(svg_name, false);
REQUIRE(marker);
REQUIRE(marker->is<mapnik::marker_svg>());
mapnik::marker_svg const& svg = mapnik::util::get<mapnik::marker_svg>(*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));
}
}

0 comments on commit 2aab39b

Please sign in to comment.