File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Sources/ComponentsKit/Components/CircularProgress/Models Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -90,15 +90,12 @@ extension CircularProgressVM {
90
90
let step = stripeWidth + stripeSpacing
91
91
let radians = stripeAngle. radians
92
92
93
- let startY = - rect. width
94
- let endY = rect. height + rect. width
95
-
96
- for y in stride ( from: startY, through: endY, by: step) {
97
- let topLeft = CGPoint ( x: 0 , y: y)
98
- let topRight = CGPoint ( x: 0 , y: y + stripeWidth)
99
-
100
- let bottomLeft = CGPoint ( x: rect. width, y: y + tan( radians) * rect. width)
101
- let bottomRight = CGPoint ( x: rect. width, y: ( y + stripeWidth) + tan( radians) * rect. width)
93
+ let dx : CGFloat = rect. height * tan( radians)
94
+ for x in stride ( from: 0 , through: rect. width + rect. height, by: step) {
95
+ let topLeft = CGPoint ( x: x, y: 0 )
96
+ let topRight = CGPoint ( x: x + stripeWidth, y: 0 )
97
+ let bottomLeft = CGPoint ( x: x + dx, y: rect. height)
98
+ let bottomRight = CGPoint ( x: x + stripeWidth + dx, y: rect. height)
102
99
103
100
path. move ( to: topLeft)
104
101
path. addLine ( to: topRight)
You can’t perform that action at this time.
0 commit comments