Skip to content

Commit 7c2e6b0

Browse files
committed
Merge pull request #61 from jhersh/arm64-floats
armv7 and arm64-friendly floats
2 parents ee706e3 + c2225cb commit 7c2e6b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Source/JTSImageViewController.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
#import "UIImage+JTSImageEffects.h"
1313
#import "UIApplication+JTSImageViewController.h"
1414

15+
CG_INLINE CGFLOAT_TYPE JTSImageFloatAbs(CGFLOAT_TYPE aFloat) {
16+
#if CGFLOAT_IS_DOUBLE
17+
return fabs(aFloat);
18+
#else
19+
return fabsf(aFloat);
20+
#endif
21+
}
22+
1523
///--------------------------------------------------------------------------------------------------------------------
1624
/// Definitions
1725
///--------------------------------------------------------------------------------------------------------------------
@@ -1594,7 +1602,7 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
15941602
}
15951603

15961604
CGPoint velocity = [scrollView.panGestureRecognizer velocityInView:scrollView.panGestureRecognizer.view];
1597-
if (scrollView.zoomScale == 1 && (fabsf(velocity.x) > 1600 || fabsf(velocity.y) > 1600 ) ) {
1605+
if (scrollView.zoomScale == 1 && (JTSImageFloatAbs(velocity.x) > 1600 || JTSImageFloatAbs(velocity.y) > 1600 ) ) {
15981606
[self dismiss:YES];
15991607
}
16001608
}

0 commit comments

Comments
 (0)