From 85c0f8c52765fb3fad098d02bc8987891080079e Mon Sep 17 00:00:00 2001
From: Manuel Kaufmann <humitos@gmail.com>
Date: Mon, 29 Oct 2012 13:04:37 -0300
Subject: [PATCH Speak] Use radians instead of degrees
Cairo.Context.arc needs the angle in radians instead of degrees. Give
it as 360 (radians) was taking up to 8 seconds to draw the eyes.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
---
eye.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/eye.py b/eye.py
index 954e68a..e1bf5b8 100644
a
|
b
|
class Eye(gtk.DrawingArea): |
125 | 125 | self.context.fill() |
126 | 126 | |
127 | 127 | # eye ball |
128 | | self.context.arc(bounds.width / 2, bounds.height / 2, eyeSize / 2 - outlineWidth / 2, 0, 360) |
| 128 | self.context.arc(bounds.width / 2, bounds.height / 2, |
| 129 | eyeSize / 2 - outlineWidth / 2, 0, 2 * math.pi) |
129 | 130 | self.context.set_source_rgb(1, 1, 1) |
130 | 131 | self.context.fill() |
131 | 132 | |
132 | 133 | # outline |
133 | 134 | self.context.set_line_width(outlineWidth) |
134 | | self.context.arc(bounds.width / 2, bounds.height / 2, eyeSize / 2 - outlineWidth / 2, 0, 360) |
| 135 | self.context.arc(bounds.width / 2, bounds.height / 2, |
| 136 | eyeSize / 2 - outlineWidth / 2, 0, 2 * math.pi) |
135 | 137 | self.context.set_source_rgb(0, 0, 0) |
136 | 138 | self.context.stroke() |
137 | 139 | |
138 | 140 | # pupil |
139 | | self.context.arc(pupilX, pupilY, pupilSize, 0, 360) |
| 141 | self.context.arc(pupilX, pupilY, pupilSize, 0, 2 * math.pi) |
140 | 142 | self.context.set_source_rgb(0, 0, 0) |
141 | 143 | self.context.fill() |
142 | 144 | |