Debian Codegraph @

examples/cairo_snippets/snippets/clip.py

raw symbols SCIP
1 from math import pi
2
3
4 def draw(cr, width, height):
5 cr.scale(width, height)
6 cr.set_line_width(0.04)
7
8 cr.arc(0.5, 0.5, 0.3, 0, 2 * pi)
9 cr.clip()
10
11 cr.rectangle(0, 0, 1, 1)
12 cr.fill()
13 cr.set_source_rgb(0, 1, 0)
14 cr.move_to(0, 0)
15 cr.line_to(1, 1)
16 cr.move_to(1, 0)
17 cr.line_to(0, 1)
18 cr.stroke()