Skip to content

Commit d1f98c9

Browse files
author
Ricardo Santos
committed
Replace the deprecated M_PI with Double.pi
1 parent 0972cf5 commit d1f98c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

FazeKit/Classes/UIImageAdditions.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ extension UIImage {
6868
transform = CGAffineTransform(translationX: imageSize.width, y: 0).scaledBy(x: -1, y: 1)
6969

7070
case .down: // EXIF = 3
71-
transform = CGAffineTransform(translationX: imageSize.width, y: imageSize.height).rotated(by: CGFloat(M_PI))
71+
transform = CGAffineTransform(translationX: imageSize.width, y: imageSize.height).rotated(by: CGFloat(Double.pi))
7272

7373
case .downMirrored: // EXIF = 4
7474
transform = CGAffineTransform(translationX: 0, y: imageSize.height).scaledBy(x: 1, y: -1)
@@ -77,25 +77,25 @@ extension UIImage {
7777
let boundsHeight = bounds.size.height
7878
bounds.size.height = bounds.size.width
7979
bounds.size.width = boundsHeight
80-
transform = CGAffineTransform(translationX: imageSize.height, y: imageSize.width).scaledBy(x: -1, y: 1).rotated(by: CGFloat(3.0 * M_PI / 2.0))
80+
transform = CGAffineTransform(translationX: imageSize.height, y: imageSize.width).scaledBy(x: -1, y: 1).rotated(by: CGFloat(3.0 * Double.pi / 2.0))
8181

8282
case .left: // EXIF = 6
8383
let boundsHeight = bounds.size.height
8484
bounds.size.height = bounds.size.width
8585
bounds.size.width = boundsHeight
86-
transform = CGAffineTransform(translationX: 0, y: imageSize.width).rotated(by: CGFloat(3.0 * M_PI / 2.0))
86+
transform = CGAffineTransform(translationX: 0, y: imageSize.width).rotated(by: CGFloat(3.0 * Double.pi / 2.0))
8787

8888
case .rightMirrored: // EXIF = 7
8989
let boundsHeight = bounds.size.height
9090
bounds.size.height = bounds.size.width
9191
bounds.size.width = boundsHeight
92-
transform = CGAffineTransform(scaleX: -1, y: 1).rotated(by: CGFloat(M_PI / 2.0))
92+
transform = CGAffineTransform(scaleX: -1, y: 1).rotated(by: CGFloat(Double.pi / 2.0))
9393

9494
case .right: // EXIF = 8
9595
let boundsHeight = bounds.size.height
9696
bounds.size.height = bounds.size.width
9797
bounds.size.width = boundsHeight
98-
transform = CGAffineTransform(translationX: imageSize.height, y: 0).rotated(by: CGFloat(M_PI / 2.0))
98+
transform = CGAffineTransform(translationX: imageSize.height, y: 0).rotated(by: CGFloat(Double.pi / 2.0))
9999
}
100100

101101
UIGraphicsBeginImageContext(bounds.size)

0 commit comments

Comments
 (0)