Diagram.py: return the vertices from draw_polygon() and draw_star() master
authorAntonio Ospite <ao2@ao2.it>
Thu, 18 Jun 2015 10:44:06 +0000 (12:44 +0200)
committerAntonio Ospite <ao2@ao2.it>
Thu, 18 Jun 2015 10:44:06 +0000 (12:44 +0200)
Diagram.py

index e2d85d5..aa6e659 100755 (executable)
@@ -124,6 +124,7 @@ class Diagram(object):
     def draw_polygon(self, cx, cy, sides, r, theta=0.0, fill_color=None, stroke_color=[0, 0, 0]):
         verts = self.get_regular_polygon(cx, cy, sides, r, theta)
         self.draw_polygon_by_verts(verts, fill_color, stroke_color)
     def draw_polygon(self, cx, cy, sides, r, theta=0.0, fill_color=None, stroke_color=[0, 0, 0]):
         verts = self.get_regular_polygon(cx, cy, sides, r, theta)
         self.draw_polygon_by_verts(verts, fill_color, stroke_color)
+        return verts
 
     def draw_star_by_verts(self, cx, cy, verts, stroke_color=[0, 0, 0]):
         cr = self.cr
 
     def draw_star_by_verts(self, cx, cy, verts, stroke_color=[0, 0, 0]):
         cr = self.cr
@@ -142,6 +143,7 @@ class Diagram(object):
 
             verts = self.get_regular_polygon(cx, cy, sides, apothem, apothem_angle)
             self.draw_star_by_verts(cx, cy, verts, stroke_color)
 
             verts = self.get_regular_polygon(cx, cy, sides, apothem, apothem_angle)
             self.draw_star_by_verts(cx, cy, verts, stroke_color)
+            return verts
 
     def draw_circle(self, cx, cy, size=10.0, fill_color=[0, 0, 0, 0.5],
                     stroke_color=None):
 
     def draw_circle(self, cx, cy, size=10.0, fill_color=[0, 0, 0, 0.5],
                     stroke_color=None):