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

Method __init__

Demo/CircleLine.py:88–107  ·  view source on GitHub ↗
(self, background, width, height)

Source from the content-addressed store, hash-verified

86class Circle:
87
88 def __init__(self, background, width, height):
89 self.background = background
90 self.x = randRange(-width / 2, width / 2)
91 self.y = randRange(-height / 2, height / 2)
92 self.radius = hyperRange(radMin, radMax)
93 self.filled = (False if randint(
94 0, 100) > concentricCircle else 'full') if self.radius < radThreshold else (
95 False if randint(0, 100) > concentricCircle else 'concentric')
96 self.color = colors[randint(0, len(colors) - 1)]
97 self.borderColor = colors[randint(0, len(colors) - 1)]
98 self.opacity = 0.05
99 self.speed = randRange(speedMin, speedMax) # * (radMin / self.radius)
100 self.speedAngle = random() * 2 * pi
101 self.speedx = cos(self.speedAngle) * self.speed
102 self.speedy = sin(self.speedAngle) * self.speed
103 spacex = abs((self.x - (-1 if self.speedx < 0 else 1) *
104 (width / 2 + self.radius)) / self.speedx)
105 spacey = abs((self.y - (-1 if self.speedy < 0 else 1) *
106 (height / 2 + self.radius)) / self.speedy)
107 self.ttl = min(spacex, spacey)
108
109
110class CircleLineWindow(QWidget):

Callers 1

__init__Method · 0.45

Calls 3

randRangeFunction · 0.85
hyperRangeFunction · 0.85
randintFunction · 0.85

Tested by

no test coverage detected