Skip to content

Commit

Permalink
armv7 and arm64-friendly floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hersh committed Apr 18, 2015
1 parent ee706e3 commit c2225cb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/JTSImageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
#import "UIImage+JTSImageEffects.h"
#import "UIApplication+JTSImageViewController.h"

CG_INLINE CGFLOAT_TYPE JTSImageFloatAbs(CGFLOAT_TYPE aFloat) {
#if CGFLOAT_IS_DOUBLE
return fabs(aFloat);
#else
return fabsf(aFloat);
#endif
}

///--------------------------------------------------------------------------------------------------------------------
/// Definitions
///--------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1594,7 +1602,7 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
}

CGPoint velocity = [scrollView.panGestureRecognizer velocityInView:scrollView.panGestureRecognizer.view];
if (scrollView.zoomScale == 1 && (fabsf(velocity.x) > 1600 || fabsf(velocity.y) > 1600 ) ) {
if (scrollView.zoomScale == 1 && (JTSImageFloatAbs(velocity.x) > 1600 || JTSImageFloatAbs(velocity.y) > 1600 ) ) {
[self dismiss:YES];
}
}
Expand Down

0 comments on commit c2225cb

Please sign in to comment.