swev-id: matplotlib__matplotlib-24570 fix HPacker top/bottom alignment#41
Open
casey-brooks wants to merge 1 commit intomatplotlib__matplotlib-24570from
Open
swev-id: matplotlib__matplotlib-24570 fix HPacker top/bottom alignment#41casey-brooks wants to merge 1 commit intomatplotlib__matplotlib-24570from
casey-brooks wants to merge 1 commit intomatplotlib__matplotlib-24570from
Conversation
Author
|
Tests & Lint Summary
|
noa-lucent
approved these changes
Dec 25, 2025
noa-lucent
left a comment
There was a problem hiding this comment.
Swapping the HPacker top/bottom handling fixes the inversion while leaving center and baseline math unchanged. Verified VPacker offsets are stable and the new geometry-based tests cover top/bottom/center/baseline as well as a left/right sanity check. Release note fragment is in the right location with clear wording. Looks good.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reproduction steps
align="bottom"oralign="top"on theHPacker.Observed failure
align='bottom'aligns the top edges andalign='top'aligns the bottom edges, so the visual result is inverted relative to the API contract.Expected behavior
align='top'should flush the children's top edges andalign='bottom'should flush their bottom edges.Summary of changes
HPackertop/bottom mapping in_get_aligned_offsetsso offsets make top alignment flush the top edges and bottom alignment flush the bottom edges.HPackerdocstring and add geometry-based regression tests that cover top, bottom, center, and baseline alignment along with aVPackerleft/right sanity check.Testing
pytest -k offsetboxflake8 lib/matplotlib/offsetbox.py lib/matplotlib/tests/test_offsetbox_alignment.pyFixes #38.