MCPcopy Create free account
hub / github.com/ActiveState/code / redraw

Method redraw

recipes/Python/578875_Analog_Clock/recipe-578875.py:201–210  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

199 ## Redraws the whole clock.
200 #
201 def redraw(self):
202 start = pi/2 # 12h is at pi/2
203 step = pi/6
204 for i in range(12): # draw the minute ticks as circles
205 angle = start-i*step
206 x, y = cos(angle),sin(angle)
207 self.paintcircle(x,y)
208 self.painthms() # draw the handles
209 if not self.showImage:
210 self.paintcircle(0,0) # draw a circle at the centre of the clock
211
212 ## Draws the handles.
213 #

Callers 2

resizeMethod · 0.95
pollMethod · 0.95

Calls 5

paintcircleMethod · 0.95
painthmsMethod · 0.95
rangeFunction · 0.85
cosFunction · 0.85
sinFunction · 0.85

Tested by

no test coverage detected