@@ -198,11 +198,11 @@ - (instancetype) initWithPicker:(canLoadPixels *) _picker
198198 */
199199 UIInterfaceOrientation orientation = [UIApplication sharedApplication ].statusBarOrientation ;
200200 if (orientation == UIInterfaceOrientationLandscapeLeft) {
201- _imagePicker.view .transform = CGAffineTransformMakeRotation (-PI* 0.5 );
201+ _imagePicker.view .transform = CGAffineTransformMakeRotation (-glm::half_pi< float >() );
202202 } else if (orientation == UIInterfaceOrientationLandscapeRight) {
203- _imagePicker.view .transform = CGAffineTransformMakeRotation (PI* 0.5 );
203+ _imagePicker.view .transform = CGAffineTransformMakeRotation (glm::half_pi< float >() );
204204 } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) {
205- _imagePicker.view .transform = CGAffineTransformMakeRotation (PI );
205+ _imagePicker.view .transform = CGAffineTransformMakeRotation (glm::pi< float >() );
206206 }
207207 }
208208
@@ -330,11 +330,11 @@ - (BOOL) showCameraOverlayWithCustomView:(UIView *)overlayView {
330330 overlay.center = CGPointMake (screenSize.width * 0.5 , screenSize.height * 0.5 );
331331 UIInterfaceOrientation orientation = [UIApplication sharedApplication ].statusBarOrientation ;
332332 if (orientation == UIInterfaceOrientationLandscapeLeft) {
333- overlay.transform = CGAffineTransformMakeRotation (-PI * 0.5 );
333+ overlay.transform = CGAffineTransformMakeRotation (-glm::half_pi< float >() );
334334 } else if (orientation == UIInterfaceOrientationLandscapeRight) {
335- overlay.transform = CGAffineTransformMakeRotation (PI * 0.5 );
335+ overlay.transform = CGAffineTransformMakeRotation (glm::half_pi< float >() );
336336 } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) {
337- overlay.transform = CGAffineTransformMakeRotation (PI );
337+ overlay.transform = CGAffineTransformMakeRotation (glm::pi< float >() );
338338 }
339339 }
340340
@@ -458,7 +458,7 @@ - (UIImage *)scaleAndRotateImage:(UIImage *)image {
458458 break ;
459459 case UIImageOrientationDown:
460460 transform = CGAffineTransformMakeTranslation (imageSize.width , imageSize.height );
461- transform = CGAffineTransformRotate (transform, M_PI );
461+ transform = CGAffineTransformRotate (transform, glm::pi< float >() );
462462 break ;
463463 case UIImageOrientationDownMirrored:
464464 transform = CGAffineTransformMakeTranslation (0.0 , imageSize.height );
@@ -470,28 +470,28 @@ - (UIImage *)scaleAndRotateImage:(UIImage *)image {
470470 bounds.size .width = boundHeight;
471471 transform = CGAffineTransformMakeTranslation (imageSize.height , imageSize.width );
472472 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 >() );
474474 break ;
475475 case UIImageOrientationLeft:
476476 boundHeight = bounds.size .height ;
477477 bounds.size .height = bounds.size .width ;
478478 bounds.size .width = boundHeight;
479479 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 >() );
481481 break ;
482482 case UIImageOrientationRightMirrored:
483483 boundHeight = bounds.size .height ;
484484 bounds.size .height = bounds.size .width ;
485485 bounds.size .width = boundHeight;
486486 transform = CGAffineTransformMakeScale (-1.0 , 1.0 );
487- transform = CGAffineTransformRotate (transform, M_PI / 2.0 );
487+ transform = CGAffineTransformRotate (transform, glm::half_pi< float >() );
488488 break ;
489489 case UIImageOrientationRight:
490490 boundHeight = bounds.size .height ;
491491 bounds.size .height = bounds.size .width ;
492492 bounds.size .width = boundHeight;
493493 transform = CGAffineTransformMakeTranslation (imageSize.height , 0.0 );
494- transform = CGAffineTransformRotate (transform, M_PI / 2.0 );
494+ transform = CGAffineTransformRotate (transform, glm::half_pi< float >() );
495495 break ;
496496 default :
497497 [NSException raise: NSInternalInconsistencyException format: @" Invalid image orientation" ];
0 commit comments