@@ -198,11 +198,11 @@ - (instancetype) initWithPicker:(canLoadPixels *) _picker
198
198
*/
199
199
UIInterfaceOrientation orientation = [UIApplication sharedApplication ].statusBarOrientation ;
200
200
if (orientation == UIInterfaceOrientationLandscapeLeft) {
201
- _imagePicker.view .transform = CGAffineTransformMakeRotation (-PI* 0.5 );
201
+ _imagePicker.view .transform = CGAffineTransformMakeRotation (-glm::half_pi< float >() );
202
202
} else if (orientation == UIInterfaceOrientationLandscapeRight) {
203
- _imagePicker.view .transform = CGAffineTransformMakeRotation (PI* 0.5 );
203
+ _imagePicker.view .transform = CGAffineTransformMakeRotation (glm::half_pi< float >() );
204
204
} else if (orientation == UIInterfaceOrientationPortraitUpsideDown) {
205
- _imagePicker.view .transform = CGAffineTransformMakeRotation (PI );
205
+ _imagePicker.view .transform = CGAffineTransformMakeRotation (glm:: pi < float >() );
206
206
}
207
207
}
208
208
@@ -330,11 +330,11 @@ - (BOOL) showCameraOverlayWithCustomView:(UIView *)overlayView {
330
330
overlay.center = CGPointMake (screenSize.width * 0.5 , screenSize.height * 0.5 );
331
331
UIInterfaceOrientation orientation = [UIApplication sharedApplication ].statusBarOrientation ;
332
332
if (orientation == UIInterfaceOrientationLandscapeLeft) {
333
- overlay.transform = CGAffineTransformMakeRotation (-PI * 0.5 );
333
+ overlay.transform = CGAffineTransformMakeRotation (-glm::half_pi< float >() );
334
334
} else if (orientation == UIInterfaceOrientationLandscapeRight) {
335
- overlay.transform = CGAffineTransformMakeRotation (PI * 0.5 );
335
+ overlay.transform = CGAffineTransformMakeRotation (glm::half_pi< float >() );
336
336
} else if (orientation == UIInterfaceOrientationPortraitUpsideDown) {
337
- overlay.transform = CGAffineTransformMakeRotation (PI );
337
+ overlay.transform = CGAffineTransformMakeRotation (glm:: pi < float >() );
338
338
}
339
339
}
340
340
@@ -458,7 +458,7 @@ - (UIImage *)scaleAndRotateImage:(UIImage *)image {
458
458
break ;
459
459
case UIImageOrientationDown:
460
460
transform = CGAffineTransformMakeTranslation (imageSize.width , imageSize.height );
461
- transform = CGAffineTransformRotate (transform, M_PI );
461
+ transform = CGAffineTransformRotate (transform, glm:: pi < float >() );
462
462
break ;
463
463
case UIImageOrientationDownMirrored:
464
464
transform = CGAffineTransformMakeTranslation (0.0 , imageSize.height );
@@ -470,28 +470,28 @@ - (UIImage *)scaleAndRotateImage:(UIImage *)image {
470
470
bounds.size .width = boundHeight;
471
471
transform = CGAffineTransformMakeTranslation (imageSize.height , imageSize.width );
472
472
transform = CGAffineTransformScale (transform, -1.0 , 1.0 );
473
- transform = CGAffineTransformRotate (transform, 3.0 * M_PI / 2.0 );
473
+ transform = CGAffineTransformRotate (transform, glm:: pi < float >() + glm::half_pi< float >() );
474
474
break ;
475
475
case UIImageOrientationLeft:
476
476
boundHeight = bounds.size .height ;
477
477
bounds.size .height = bounds.size .width ;
478
478
bounds.size .width = boundHeight;
479
479
transform = CGAffineTransformMakeTranslation (0.0 , imageSize.width );
480
- transform = CGAffineTransformRotate (transform, 3.0 * M_PI / 2.0 );
480
+ transform = CGAffineTransformRotate (transform, glm:: pi < float >() + glm::half_pi< float >() );
481
481
break ;
482
482
case UIImageOrientationRightMirrored:
483
483
boundHeight = bounds.size .height ;
484
484
bounds.size .height = bounds.size .width ;
485
485
bounds.size .width = boundHeight;
486
486
transform = CGAffineTransformMakeScale (-1.0 , 1.0 );
487
- transform = CGAffineTransformRotate (transform, M_PI / 2.0 );
487
+ transform = CGAffineTransformRotate (transform, glm::half_pi< float >() );
488
488
break ;
489
489
case UIImageOrientationRight:
490
490
boundHeight = bounds.size .height ;
491
491
bounds.size .height = bounds.size .width ;
492
492
bounds.size .width = boundHeight;
493
493
transform = CGAffineTransformMakeTranslation (imageSize.height , 0.0 );
494
- transform = CGAffineTransformRotate (transform, M_PI / 2.0 );
494
+ transform = CGAffineTransformRotate (transform, glm::half_pi< float >() );
495
495
break ;
496
496
default :
497
497
[NSException raise :NSInternalInconsistencyException format: @" Invalid image orientation" ];
0 commit comments