Debian Codegraph @

examples/cairo_snippets/snippets/curve_to.py

raw symbols SCIP
1 def draw(cr, width, height):
2 cr.scale(width, height)
3 cr.set_line_width(0.04)
4
5 x, y = 0.1, 0.5
6 x1, y1 = 0.4, 0.9
7 x2, y2 = 0.6, 0.1
8 x3, y3 = 0.9, 0.5
9
10 cr.move_to(x, y)
11 cr.curve_to(x1, y1, x2, y2, x3, y3)
12
13 cr.stroke()
14
15 cr.set_source_rgba(1, 0.2, 0.2, 0.6)
16 cr.set_line_width(0.03)
17 cr.move_to(x, y)
18 cr.line_to(x1, y1)
19 cr.move_to(x2, y2)
20 cr.line_to(x3, y3)
21 cr.stroke()