Changeset 222c05746e7b…
Parent 5f2e71ec6bc8…
by
Changes to one file · Browse files at 222c05746e7b Showing diff from parent 5f2e71ec6bc8 Diff from another changeset...
@@ -185,16 +185,31 @@ ctx.line_to(x + 1, y + inc)
ctx.line_to(x - 2, y)
ctx.stroke_preserve()
+
+ def draw_star(x, y, radius, nodes):
+ total_nodes = nodes * 2 #inner + outer nodes
+ angle = 2 * math.pi / total_nodes;
+ for value in range(total_nodes + 1): # + 1 = backing to the start to close
+ radius_point = radius
+ if value % 2:
+ radius_point = 0.4 * radius_point;
+ arc_y = y - math.sin(angle * value) * radius_point
+ arc_x = x - math.cos(angle * value) * radius_point
+ if value == 0:
+ ctx.move_to(arc_x,arc_y)
+ else:
+ ctx.line_to(arc_x, arc_y)
+
arrow_y = arc_start_position_y - box_size / 4
arrow_x = arc_start_position_x + 7;
- ctx.rectangle(arrow_x, arrow_y, 2, 5)
if status == -1: # Outgoing arrow
+ ctx.rectangle(arrow_x, arrow_y, 2, 5)
draw_arrow(arrow_x, arrow_y, -3)
elif status == 1: # New changeset, recently added to tip
- # TODO: someone improve this, please
ctx.set_source_rgb(0, 1, 0)
- ctx.arc(arrow_x, arrow_y, box_size / 5, 0, 2 * math.pi)
+ draw_star(arrow_x + box_size / 4, arc_start_position_y , 4, 6)
elif status == 2: # Incoming (bundle preview) arrow
+ ctx.rectangle(arrow_x, arrow_y, 2, 5)
draw_arrow(arrow_x, arrow_y + 5, 3)
ctx.stroke_preserve()
|
Loading...