Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

history: draw a star for new changeset added

Changeset 222c05746e7b

Parent 5f2e71ec6bc8

by Diego Oliveira

Changes to one file · Browse files at 222c05746e7b Showing diff from parent 5f2e71ec6bc8 Diff from another changeset...

 
185
186
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
189
190
191
 
192
193
194
195
196
 
197
 
198
199
200
 
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
 
205
206
207
208
 
209
 
210
211
212
213
214
215
@@ -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()