diff options
author | flavio <fdanesse@gmail.com> | 2012-07-19 00:05:25 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2012-07-19 00:05:25 (GMT) |
commit | c1b905046c4bfd681a82f32d9c26cefb789aed1b (patch) | |
tree | 9a5a6a4bd990665ecace471ed02ff0cbba3e9c32 /glasses.py | |
parent | 773832227b3309e9ba327de6a4ebb5cc42b0b367 (diff) |
Cairo corrections
Diffstat (limited to 'glasses.py')
-rw-r--r-- | glasses.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -28,7 +28,7 @@ class Glasses(Eye): def __init__(self, fill_color): Eye.__init__(self, fill_color) - def expose(self, widget, event): + def do_draw(self, context): bounds = self.get_allocation() eyeSize = min(bounds.width, bounds.height) @@ -43,15 +43,15 @@ class Glasses(Eye): pupilX = bounds.width / 2 + dX * limit / distance pupilY = bounds.height / 2 + dY * limit / distance - self.context = widget.window.cairo_create() + self.context = context #self.context.set_antialias(cairo.ANTIALIAS_NONE) #set a clip region for the expose event. # This reduces redrawing work (and time) - self.context.rectangle(event.area.x, - event.area.y, - event.area.width, - event.area.height) + self.context.rectangle(bounds.x, + bounds.y, + bounds.width, + bounds.height) self.context.clip() # background |