| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Why not let get_tightbox return None instead working around the non-finite bbox? |
Sorry, something went wrong.
|
@Tillsten you mean get_tightbbox of the axes children? I think thats a good idea as well, but I wasn't sure I'd be able to squash all possible get_tightbbox implementations. I think I'll do that for the base Artist.get_tightbbox, but maybe keep this check too in case someone has done something special. |
Sorry, something went wrong.
|
@Tillsten added the check in both places now. The one in Axes._get_tightbbox can't hurt (except maybe the eyes for the long if-statement). |
Sorry, something went wrong.
There was a problem hiding this comment.
Returning None instead of an infinite BBox is an API change. I'm -1 on that as I don't see any benefit. In contrast, it obscures information. An infinite BBox is a defined object. You can e.g. still find out if the width or height is infinite.
Sorry, something went wrong.
|
Yeah I’m flexible about that. The original PR didn’t have this - it just checked for finite bbox widths and heights. OTOH it’s not necessarily a bad idea to invalidate things we know we can’t do anything with. A NaN bbox width is not going to mean anything and pushing all the checks to a higher level just means more checks at a higher level. |
Sorry, something went wrong.
You'll have a new bbox is None check to do anyway at the higher level. If desired you could alternatively add an is_finite() method and check bbox.is_finite(). (Or maybe is_valid() - Qt uses this naming convention.) Edit: Would need careful consideration on the actual naming of such a method. |
Sorry, something went wrong.
|
Right but we already check for None. Not sure why, though. |
Sorry, something went wrong.
|
Removed artist.get_tightbbox returning None if non-finite bbox. |
Sorry, something went wrong.
Has been addressed and API is not changed.
…651-on-v3.0.x Backport PR #12651 on branch v3.0.x (FIX: ignore non-finite bbox)
| Back | FazBrowse Home | New Git URL |
PR Summary
closes #12648
Previously, ax.get_tightbbox would find a non-finite bbox because text's bbox was not defined. This ignores such bbox's when getting the axes bbox.
PR Checklist