MCPcopy Index your code
hub / github.com/PyQt5/PyQt / draw

Method draw

Demo/CircleLine.py:155–175  ·  view source on GitHub ↗
(self, painter)

Source from the content-addressed store, hash-verified

153 self.draw(painter)
154
155 def draw(self, painter):
156 if circlePulse:
157 if circleExp < circleExpMin or circleExp > circleExpMax:
158 circleExpSp *= -1
159 circleExp += circleExpSp
160
161 painter.translate(self.screenWidth / 2, self.screenHeight / 2)
162
163 if self._firstDraw:
164 t = time()
165 self.renderPoints(painter, points)
166 if self._firstDraw:
167 self._firstDraw = False
168 # 此处有个比例关系用于设置timer的时间,如果初始窗口很小,没有比例会导致动画很快
169 t = (time() - t) * 1000 * 2
170 # 比例最大不能超过1920/800
171 t = int(min(2.4, self.screenHeight / self.height()) * t) - 1
172 t = t if t > 15 else 15 # 不能小于15s
173 print('start timer(%d msec)' % t)
174 # 开启定时器
175 self._timer.start(t)
176
177 def drawCircle(self, painter, circle):
178 # circle.radius *= circleExp

Callers 2

paintEventMethod · 0.95
animateFunction · 0.80

Calls 3

renderPointsMethod · 0.95
heightMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected