diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2012-10-29 16:28:23 (GMT) |
---|---|---|
committer | Rafael Ortiz <rafael@activitycentral.com> | 2012-10-31 14:32:56 (GMT) |
commit | 4a3727eb55ddade829e0dd940d33b89da8f2f2eb (patch) | |
tree | c7cb78770b5f580885aebf38cffb5f645c1a4b73 | |
parent | 38e8024cb3e985b69f16638102e9da0b9a3f9212 (diff) |
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>
-rw-r--r-- | eye.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -125,18 +125,20 @@ class Eye(gtk.DrawingArea): self.context.fill() # eye ball - self.context.arc(bounds.width / 2, bounds.height / 2, eyeSize / 2 - outlineWidth / 2, 0, 360) + self.context.arc(bounds.width / 2, bounds.height / 2, + eyeSize / 2 - outlineWidth / 2, 0, 2 * math.pi) self.context.set_source_rgb(1, 1, 1) self.context.fill() # outline self.context.set_line_width(outlineWidth) - self.context.arc(bounds.width / 2, bounds.height / 2, eyeSize / 2 - outlineWidth / 2, 0, 360) + self.context.arc(bounds.width / 2, bounds.height / 2, + eyeSize / 2 - outlineWidth / 2, 0, 2 * math.pi) self.context.set_source_rgb(0, 0, 0) self.context.stroke() # pupil - self.context.arc(pupilX, pupilY, pupilSize, 0, 360) + self.context.arc(pupilX, pupilY, pupilSize, 0, 2 * math.pi) self.context.set_source_rgb(0, 0, 0) self.context.fill() |