Skip to content

Commit 8bde517

Browse files
HooJYchili-ios
authored andcommitted
fix pageControl is not round (#42)
1 parent 6595ca9 commit 8bde517

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CHIPageControl/CHIPageControlAji.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ open class CHIPageControlAji: CHIBasePageControl {
6060
super.layoutSubviews()
6161

6262
let floatCount = CGFloat(inactive.count)
63-
let x = (self.bounds.size.width - self.diameter*floatCount - self.padding*(floatCount-1))*0.5
64-
let y = (self.bounds.size.height - self.diameter)*0.5
63+
let x = ceil((self.bounds.size.width - self.diameter*floatCount - self.padding*(floatCount-1))*0.5)
64+
let y = ceil((self.bounds.size.height - self.diameter)*0.5)
6565
var frame = CGRect(x: x, y: y, width: self.diameter, height: self.diameter)
6666

6767
active.cornerRadius = self.radius

0 commit comments

Comments
 (0)