Skip to content

set_line_width: raise a clear error for a negative width - #2076

Merged
andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:line-width-negative
Oct 28, 2026
Merged

andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:line-width-negative

Conversation

@RavSinghChandan

Copy link
Copy Markdown

set_line_width(-1) wrote -2.83 w into the page content. The PDF specification requires a line width of zero or more, so it now raises ValueError: Line width must be zero or a positive number, like set_dash_pattern() does for a negative dash length.

  • A unit test is covering the code added / modified by this PR
  • A mention of the change is present in CHANGELOG.md
  • This PR is ready to be merged

@andersonhc
andersonhc merged commit a85535e into py-pdf:master Oct 28, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants