-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix Agg extent calculations for empty draws #12117
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
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.
I wrote the patch but let's say this approval as @dstansby's :p
Can you please add a test? |
👍 done, and checked that it fails on master without this PR |
Great! Thanks @dstansby ! |
…117-on-v3.0.x Backport PR #12117 on branch v3.0.x (Fix Agg extent calculations for empty draws)
…117-on-v2.2.x Backport PR #12117 on branch v2.2.x (Fix Agg extent calculations for empty draws)
r.y1 = std::max(0, r.y1); | ||
r.x2 = std::min(r.x2 + 1, (int)width); | ||
r.y2 = std::min(r.y2 + 1, (int)height); | ||
if (r.x1 == width && r.x2 == 0) { |
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.
This causes a warning now:
src/_backend_agg.cpp: In member function ‘agg::rect_i RendererAgg::get_content_extents()’:
src/_backend_agg.cpp:204:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
if (r.x1 == width && r.x2 == 0) {
~~~~~^~~~~~~~
Fixes #12003. Putting this on 2.2.4, since it fixes plotting rasterised .pdf files with numpy 1.15.