-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG parser refactoring and improvements #3003
Conversation
…lect error messages
SVG spec : ".. If 'rx' is greater than half of the width of the rectangle, then the user agent must process the 'rect' element with the effective value for 'rx' as half of the width of the rectangle. If 'ry' is greater than half of the height of the rectangle, then the user agent must process the 'rect' element with the effective value for 'ry' as half of the height of the rectangle.."
{ | ||
for (auto const& msg : p.error_messages()) | ||
{ | ||
std::cerr << "SVG PARSING ERROR:\"" << msg << "\"" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakepruitt - yes, fixed in 3a4d574. I also made marker_cache
to return marker_null()
if case of any parsing/values errors. I think this is desired logic : only accept SVG we can interpret correctly and fail otherwise + logging errors.
REQUIRE(y1 == 25); | ||
REQUIRE(x2 == 10); | ||
REQUIRE(y2 == 10); | ||
REQUIRE(r == 75); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question, @artemp. The gradient fixture for this test has the following format
<radialGradient id="grad1b" gradientUnits="userSpaceOnUse" cx="10%" cy="10%" r="75%" fx="00.00%" fy="25%">
This translates to the above values when get_control_points
is called. Is this the expected value? Should the values be 0, 0.25, 0.10, 0.10, 0.75
respectively due to the percentage conversion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakepruitt - great catch! this was a bug in grammar - fixed in 42bf230
Summary of main changes
|
SVG parser refactoring and improvements
Change to RapidXml made in: mapnik#3003
ptree
(rapidxml inside boost::property_tree) as default xml parserFollowups: