projects
/
experiments
/
RadialSymmetry.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Diagram.py: simplify draw_star()
[experiments/RadialSymmetry.git]
/
RadialSymmetryDiagram.py
diff --git
a/RadialSymmetryDiagram.py
b/RadialSymmetryDiagram.py
index
e6bc383
..
333606a
100755
(executable)
--- a/
RadialSymmetryDiagram.py
+++ b/
RadialSymmetryDiagram.py
@@
-43,9
+43,6
@@
class RadialSymmetryModel():
class RadialSymmetryDiagram(Diagram.Diagram):
class RadialSymmetryDiagram(Diagram.Diagram):
- def __init__(self, width, height, background=[1, 1, 1]):
- Diagram.Diagram.__init__(self, width, height, background)
-
def draw(self, model):
cx = self.width / 2.0
cy = self.height / 2.0
def draw(self, model):
cx = self.width / 2.0
cy = self.height / 2.0
@@
-92,9
+89,9
@@
class RadialSymmetryDiagram(Diagram.Diagram):
if model.show_labels:
ta = self.normalized_angle_01(rotated_radial_orientation_angle)
text = ("%.2f" % (ta * 360)).rstrip('0').rstrip('.')
if model.show_labels:
ta = self.normalized_angle_01(rotated_radial_orientation_angle)
text = ("%.2f" % (ta * 360)).rstrip('0').rstrip('.')
- color = colorsys.hsv_to_rgb(a, 1.0, 1.0)
self.draw_centered_text(v[0], v[1], text,
self.draw_centered_text(v[0], v[1], text,
- rotated_radial_orientation_angle, color)
+ rotated_radial_orientation_angle, color,
+ align_baseline=True)
def draw_element(self, x, y, model, theta, color=[0, 0, 0]):
if model.show_elements:
def draw_element(self, x, y, model, theta, color=[0, 0, 0]):
if model.show_elements: