Skip to content

Commit

Permalink
Merge branch '62.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed May 30, 2024
2 parents a8ed5c1 + 21829a2 commit 4773d32
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions weasyprint/svg/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ def draw_gradient(svg, node, gradient, font_size, opacity, stroke):
bx2, by2 = transform_matrix.invert.transform_point(width, height)
width, height = bx2 - bx1, by2 - by1

# Ensure that width and height are positive to please some PDF readers
if bx1 > bx2:
width = -width
bx1, bx2 = bx2, bx1
if by1 > by2:
height = -height
by1, by2 = by2, by1
# Ensure that width and height are positive to please some PDF readers
if bx1 > bx2:
width = -width
bx1, bx2 = bx2, bx1
if by1 > by2:
height = -height
by1, by2 = by2, by1

pattern = svg.stream.add_pattern(
bx1, by1, width, height, width, height, matrix @ svg.stream.ctm)
Expand Down

0 comments on commit 4773d32

Please sign in to comment.