MCPcopy
hub / github.com/PyQt5/PyQt / initPoints

Method initPoints

QPropertyAnimation/RlatticeEffect.py:167–185  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

165 self.update()
166
167 def initPoints(self):
168 t = time()
169 self.points.clear()
170 # 创建点
171 stepX = self.width() / 20
172 stepY = self.height() / 20
173 for x in range(0, self.width(), int(stepX)):
174 for y in range(0, self.height(), int(stepY)):
175 ox = x + random() * stepX
176 oy = y + random() * stepY
177 point = Point(ox, ox, oy, oy)
178 point.valueChanged.connect(self.update)
179 self.points.append(point)
180 print(time() - t)
181
182 t = time()
183 # 每个点寻找5个闭合点
184 findClose(self.points)
185 print(time() - t)
186
187 def animate(self, painter):
188 for p in self.points:

Callers 1

__init__Method · 0.95

Calls 5

PointClass · 0.85
findCloseFunction · 0.85
clearMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected