-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix #5895: Properly clip MOVETO commands #5911
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
Conversation
Travis failed with lots of small differences. |
This is passing Travis now and ready for final review. |
} | ||
|
||
while ((code = m_source->vertex(x, y)) != agg::path_cmd_stop) { | ||
if (code == (agg::path_cmd_end_poly | agg::path_flags_close)) { | ||
switch (code) { | ||
case (agg::path_cmd_end_poly | agg::path_flags_close): |
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.
what does this line do? My attempts to understand this by writing code have not gone well
// switch_statement1.cpp
#include <iostream>
enum test_e
{
A, B, C
};
void helper(test_e inp)
{
switch (inp)
{
case (A | B):
std::cout<< "One"<< std::endl;
break;
case C:
std::cout<< "Three"<< std::endl;
break;
default:
std::cout<< "NONE?!"<< std::endl;
}
}
int main() {
helper(A);
helper(B);
helper(C);
}
gives
22:07 $ ./a.out
NONE?!
One
Three
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.
with some digging I now see that this filtering with two things that just look like they are members of the same enum set.
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.
The value agg::path_cmd_end_poly | agg::path_flags_close
is how Agg indicates the end of a path that is also closed. Why that's not a single enum value, I don't know, but that's how it's done in Agg so we must follow. If it makes the code clearer I could create a new alias:
end_and_close_poly = agg::path_cmd_end_poly | agg::path_flags_close
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.
Nah, I am just on a wading-into-c-code-I-do-not-understand kick the last few days.
Fix #5895: Properly clip MOVETO commands
Fix #5895: Properly clip MOVETO commands Conflicts: lib/matplotlib/tests/baseline_images/test_axes/log_scales.svg kept master version of file
back ported as 512c8d0 |
Fix matplotlib#5895: Properly clip MOVETO commands Conflicts: lib/matplotlib/tests/baseline_images/test_axes/log_scales.svg kept master version of file
I haven't run the tests on this yet... we'll see what Travis CI thinks.