Skip to content

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

Merged
merged 2 commits into from
Sep 15, 2018
Merged

Conversation

dstansby
Copy link
Member

Fixes #12003. Putting this on 2.2.4, since it fixes plotting rasterised .pdf files with numpy 1.15.

@dstansby dstansby added this to the v2.2.4 milestone Sep 14, 2018
Copy link
Contributor

@anntzer anntzer left a 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

@NelleV
Copy link
Member

NelleV commented Sep 14, 2018

Can you please add a test?

@dstansby
Copy link
Member Author

👍 done, and checked that it fails on master without this PR

@NelleV
Copy link
Member

NelleV commented Sep 15, 2018

Great! Thanks @dstansby !

@NelleV NelleV merged commit 5235f52 into matplotlib:master Sep 15, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 15, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 15, 2018
@dstansby dstansby deleted the extents branch September 15, 2018 12:36
dstansby added a commit that referenced this pull request Sep 15, 2018
…117-on-v3.0.x

Backport PR #12117 on branch v3.0.x (Fix Agg extent calculations for empty draws)
dstansby pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 16, 2018
dstansby added a commit that referenced this pull request Sep 16, 2018
…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) {
Copy link
Member

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) {
         ~~~~~^~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plotting empty lists with rasterized=True causes crash on saving to pdf
4 participants