Repository navigation
rect: round the corners named in round_corners - #2098
Merged
Merged
Conversation
# Conflicts: # CHANGELOG.md
andersonhc
approved these changes
Nov 3, 2026
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.
FPDF.rect()rounds the opposite corner of the one named inround_corners, left and right being swapped:The image of the documentation shows it too: its code rounds the
BOTTOM_RIGHTcorner of the green rectangle and theTOP_LEFTandBOTTOM_LEFTcorners of the yellow square, but the image shows the bottom left corner and the right corners rounded. In_draw_rounded_rect, each corner name moved the points and drew the arc of the corner on the other side; the names in the conditions are now swapped back (and the comments of the arcs fixed to match).test_round_corners_rect_corner_positionchecks, for each corner name, that the arc is drawn in that corner of the rectangle; it fails for all four names before the fix.The three
class_round_corners_rect*.pdfreference files are regenerated: in their second row, each rectangle now has the named corner rounded.round_corners=Trueis unchanged.The documentation example passed
round_corners=("BOTTOM_RIGHT"), a string rather than a tuple, which raisesValueError: B is not a valid Corner; it now passes("BOTTOM_RIGHT",), andround_corners_rectangles.pngis regenerated from it.A unit test is covering the code added / modified by this PR
A mention of the change is present in
CHANGELOG.mdThis PR is ready to be merged