Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamus_ <mail2samus@gmail.com>2010-03-21 11:18:16 (GMT)
committer Samus_ <mail2samus@gmail.com>2010-03-21 11:25:57 (GMT)
commit29dc8e75206a0b81822a4cdf314aa79f4e8e3e49 (patch)
tree730d7b9554104001f7ed74685589b0c7f678a3f3
parent1ab0a7de798db56ea2cbd3e1d16ccb9560ebc16b (diff)
simplifying logic 2
-rwxr-xr-xfracciones.activity/gtkcake.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/fracciones.activity/gtkcake.py b/fracciones.activity/gtkcake.py
index bfc879d..f0ebeb0 100755
--- a/fracciones.activity/gtkcake.py
+++ b/fracciones.activity/gtkcake.py
@@ -58,13 +58,13 @@ class Cake(gtk.DrawingArea):
def _draw(self, context):
"""Dibuja el contenido del widget"""
- def draw_grid(context, subdivisions):
+ def draw_grid():
"""Dibuja la rejilla de la torta y sus subdivisiones"""
context.set_source_rgb(0, 0, 0)
context.arc(WIDTH/2, HEIGHT/2, RADIUS, 0, 2 * math.pi)
context.stroke()
- for i in xrange(subdivisions):
- angle = 2 * math.pi * i / subdivisions
+ for i in range(self.subdivisions):
+ angle = 2 * math.pi * i / self.subdivisions
context.move_to(WIDTH/2, HEIGHT/2)
context.line_to(
WIDTH/2 + RADIUS*math.cos(angle),
@@ -73,7 +73,7 @@ class Cake(gtk.DrawingArea):
context.stroke()
- def mask_image(context, image):
+ def mask_image(image):
"""Enmascara la imagen de la torta y dibuja solo los trozos que no
fueron seleccionados
"""
@@ -109,10 +109,10 @@ class Cake(gtk.DrawingArea):
context.paint()
# Dibuja el frente
- mask_image(context, self.image_fg)
+ mask_image(self.image_fg)
# Dibuja la rejilla
- draw_grid(context, self.subdivisions)
+ draw_grid()
def _select(self, ux, uy):