summaryrefslogtreecommitdiff
path: root/examples/spiral.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/spiral.py')
-rwxr-xr-xexamples/spiral.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/spiral.py b/examples/spiral.py
index 7be9af2..b0f3952 100755
--- a/examples/spiral.py
+++ b/examples/spiral.py
@@ -7,21 +7,21 @@ import cairo
WIDTH, HEIGHT = 600, 600
def draw_spiral (ctx, width, height):
- wd = .02 * width
- hd = .02 * height
+ wd = .02 * width
+ hd = .02 * height
- width -= 2
- height -= 2
+ width -= 2
+ height -= 2
- ctx.move_to (width + 1, 1-hd)
- for i in range(9):
- ctx.rel_line_to (0, height - hd * (2 * i - 1))
- ctx.rel_line_to (- (width - wd * (2 *i)), 0)
- ctx.rel_line_to (0, - (height - hd * (2*i)))
- ctx.rel_line_to (width - wd * (2 * i + 1), 0)
+ ctx.move_to (width + 1, 1-hd)
+ for i in range(9):
+ ctx.rel_line_to (0, height - hd * (2 * i - 1))
+ ctx.rel_line_to (- (width - wd * (2 *i)), 0)
+ ctx.rel_line_to (0, - (height - hd * (2*i)))
+ ctx.rel_line_to (width - wd * (2 * i + 1), 0)
- ctx.set_source_rgb (0, 0, 1)
- ctx.stroke()
+ ctx.set_source_rgb (0, 0, 1)
+ ctx.stroke()
surface = cairo.ImageSurface (cairo.FORMAT_ARGB32, WIDTH, HEIGHT)