projects
/
experiments
/
RadialSymmetry.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7b312eb
)
Diagram.py: allow drawing fill and stroke for circles
author
Antonio Ospite <ao2@ao2.it>
Thu, 18 Jun 2015 10:03:12 +0000
(12:03 +0200)
committer
Antonio Ospite <ao2@ao2.it>
Thu, 18 Jun 2015 10:03:12 +0000
(12:03 +0200)
Diagram.py
patch
|
blob
|
history
diff --git
a/Diagram.py
b/Diagram.py
index
1e9b172
..
ee7dd36
100755
(executable)
--- a/
Diagram.py
+++ b/
Diagram.py
@@
-132,14
+132,23
@@
class Diagram(object):
cr.set_source_rgba(r, g, b, a)
cr.stroke()
cr.set_source_rgba(r, g, b, a)
cr.stroke()
- def draw_dot(self, cx, cy, size=10.0, fill_color=[0, 0, 0, 0.5]):
+ def draw_circle(self, cx, cy, size=10.0, fill_color=[0, 0, 0, 0.5],
+ stroke_color=None):
cr = self.cr
cr.save()
cr = self.cr
cr.save()
- r, g, b, a = self.color_to_rgba(fill_color)
- cr.set_source_rgba(r, g, b, a)
cr.arc(cx, cy, size, 0, 2 * pi)
cr.arc(cx, cy, size, 0, 2 * pi)
- cr.fill()
+
+ if fill_color:
+ r, g, b, a = self.color_to_rgba(fill_color)
+ cr.set_source_rgba(r, g, b, a)
+ cr.fill()
+
+ if stroke_color:
+ r, g, b, a = self.color_to_rgba(stroke_color)
+ cr.set_source_rgba(r, g, b, a)
+ cr.stroke()
+
cr.restore()
def normalized_angle_01(self, theta):
cr.restore()
def normalized_angle_01(self, theta):