Repository navigation
31537 text wrap figure edge #31546
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
Open
FazeelUsmani
wants to merge
4
commits into
matplotlib:main
Choose a base branch
from
FazeelUsmani:31537-text-wrap-figure-edge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
31537 text wrap figure edge #31546
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a8560a9
Fix text wrap width on figure edges (#31537)
FazeelUsmani a2411fa
FIX: clamp get_rotation to [0, 360) when transform_rotates_text
FazeelUsmani 3beddd2
TST: reword transform_rotates_text wrap test comment
FazeelUsmani 2380877
Simplify cardinal handling in _get_dist_to_box
FazeelUsmani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Fix text wrap width on figure edges (#31537)
Text with wrap=True at an axis-aligned rotation on the matching figure edge collapsed to zero wrap width. In _get_dist_to_box the trig formula divides by cos(radians(90)) (~6e-17): normally that term's large value loses the min() to the sensible other side, but when the position sits exactly on the edge its numerator is also zero and the returned distance is zero. Short-circuit cardinal rotations. Also normalize rotation to [0, 360) with a small absolute tolerance so near-cardinal angles coming out of transform_angles (e.g. -90.00000000000003 via transform_rotates_text) still take the fast path instead of blowing up in the trig formula. Regression tests cover each cardinal rotation on its broken edge plus a transform_rotates_text case.
- Loading branch information
commit a8560a99572798712d59d09569e480aec910f764
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
AFAICS this is already done within
set_rotationorget_rotation.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.
Yep, missed that. Dropping the % 360 line.