Skip to content

Commit

Permalink
fixed: M_PI deprecations warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoVillanova committed Aug 15, 2017
1 parent 26393c0 commit c616423
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Pod/Classes/LiquidCircleEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LiquidCircleEffect : LiquidLoadEffect {

override func setupShape() -> [LiquittableCircle] {
return Array(0..<numberOfCircles).map { i in
let angle = CGFloat(i) * CGFloat(2 * M_PI) / 8.0
let angle = CGFloat(i) * CGFloat(2 * Double.pi) / 8.0
let frame = self.loader.frame
let center = CGMath.circlePoint(frame.center.minus(frame.origin), radius: self.radius - self.circleRadius, rad: angle)
return LiquittableCircle(
Expand All @@ -38,7 +38,7 @@ class LiquidCircleEffect : LiquidLoadEffect {
return CGMath.circlePoint(
frame,
radius: self.radius - self.circleRadius,
rad: self.key * CGFloat(2 * M_PI)
rad: self.key * CGFloat(2 * Double.pi)
)
}

Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/LiquidLineEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LiquidLineEffect : LiquidLoadEffect {
}

func sineTransform(_ key: CGFloat) -> CGFloat {
return sin(key * CGFloat(M_PI)) * 0.5 + 0.5
return sin(key * CGFloat(Double.pi)) * 0.5 + 0.5
}

override func update() {
Expand Down
4 changes: 2 additions & 2 deletions Pod/Classes/LiquidUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ func withFill(_ bezierPath: UIBezierPath, color: UIColor, f: () -> ()) {

class CGMath {
static func radToDeg(_ rad: CGFloat) -> CGFloat {
return rad * 180 / CGFloat(M_PI)
return rad * 180 / CGFloat(Double.pi)
}

static func degToRad(_ deg: CGFloat) -> CGFloat {
return deg * CGFloat(M_PI) / 180
return deg * CGFloat(Double.pi) / 180
}

static func circlePoint(_ center: CGPoint, radius: CGFloat, rad: CGFloat) -> CGPoint {
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/SimpleCircleLiquidEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SimpleCircleLiquidEngine {
fileprivate func circleConnectedPoint(_ circle: LiquittableCircle, other: LiquittableCircle) -> (CGPoint, CGPoint) {
var ratio = circleRatio(circle, other: other)
ratio = (ratio + ConnectThresh) / (1.0 + ConnectThresh)
let angle = CGFloat(M_PI_2) * ratio
let angle = CGFloat(Double.pi / 2) * ratio
return circleConnectedPoint(circle, other: other, angle: angle)
}

Expand Down

0 comments on commit c616423

Please sign in to comment.