Skip to content

Commit

Permalink
Handle evenodd fill rule with gradients and patterns
Browse files Browse the repository at this point in the history
Fix #396.
  • Loading branch information
liZe committed Aug 4, 2023
1 parent 7dea7cf commit c0a3875
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cairosvg/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ def draw(self, node):
# Fill
self.context.save()
paint_source, paint_color = paint(node.get('fill', 'black'))
if node.get('fill-rule') == 'evenodd':
self.context.set_fill_rule(cairo.FILL_RULE_EVEN_ODD)
if not gradient_or_pattern(self, node, paint_source, fill_opacity):
if node.get('fill-rule') == 'evenodd':
self.context.set_fill_rule(cairo.FILL_RULE_EVEN_ODD)
self.context.set_source_rgba(
*self.map_color(paint_color, fill_opacity))
if TAGS[node.tag] == text:
Expand Down

0 comments on commit c0a3875

Please sign in to comment.