Repository navigation
SVG: draw nothing for a <circle> without r or a <polyline> or <polygon> without points - #2168
Merged
andersonhc merged 3 commits intoNov 12, 2026
Conversation
…n> without points
…ttributes # Conflicts: # CHANGELOG.md
andersonhc
approved these changes
Nov 12, 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.
A
<circle>withoutr, and a<polyline>or<polygon>withoutpoints, fail with aKeyError. In the SVG specification the initial value ofris 0, which disables rendering, and a missingpointsis an empty list of points, so these elements draw nothing. fpdf2 already does that for an<ellipse>withoutrxandry, and forpoints="".A circle without
rcomes up with SMIL animations, where the radius is only set by an<animate attributeName="r" .../>child, for example a pulsing ring:circle()now reads a missingras 0 and returns an empty path forr="0", likeellipse();polyline()andpolygon()read a missingpointsas"". Before,r="0"drew a degenerate circle, which can show as a dot with a round-capped stroke.The
circle no r,polyline no pointsandpolygon no pointscases oftest_svg_shape_tagsexpected theKeyError; they now expect no path, and a newcircle r 0case is added. All four fail on master. The SVG tests, black and pylint pass