Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replacing roundf() with round() from thmath.h.

  • Loading branch information...
commit 0fffff8031b0aac384d2d8868d8478fbd5e2b24e 1 parent 322af01
@matej matej authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 MBProgressHUD.m
View
13 MBProgressHUD.m
@@ -5,6 +5,7 @@
//
#import "MBProgressHUD.h"
+#import <tgmath.h>
#if __has_feature(objc_arc)
@@ -555,10 +556,10 @@ - (void)layoutSubviews {
totalSize.height += 2 * margin;
// Position elements
- CGFloat yPos = roundf(((bounds.size.height - totalSize.height) / 2)) + margin + yOffset;
+ CGFloat yPos = round(((bounds.size.height - totalSize.height) / 2)) + margin + yOffset;
CGFloat xPos = xOffset;
indicatorF.origin.y = yPos;
- indicatorF.origin.x = roundf((bounds.size.width - indicatorF.size.width) / 2) + xPos;
+ indicatorF.origin.x = round((bounds.size.width - indicatorF.size.width) / 2) + xPos;
indicator.frame = indicatorF;
yPos += indicatorF.size.height;
@@ -567,7 +568,7 @@ - (void)layoutSubviews {
}
CGRect labelF;
labelF.origin.y = yPos;
- labelF.origin.x = roundf((bounds.size.width - labelSize.width) / 2) + xPos;
+ labelF.origin.x = round((bounds.size.width - labelSize.width) / 2) + xPos;
labelF.size = labelSize;
label.frame = labelF;
yPos += labelF.size.height;
@@ -577,7 +578,7 @@ - (void)layoutSubviews {
}
CGRect detailsLabelF;
detailsLabelF.origin.y = yPos;
- detailsLabelF.origin.x = roundf((bounds.size.width - detailsLabelSize.width) / 2) + xPos;
+ detailsLabelF.origin.x = round((bounds.size.width - detailsLabelSize.width) / 2) + xPos;
detailsLabelF.size = detailsLabelSize;
detailsLabel.frame = detailsLabelF;
@@ -638,8 +639,8 @@ - (void)drawRect:(CGRect)rect {
// Center HUD
CGRect allRect = self.bounds;
// Draw rounded HUD backgroud rect
- CGRect boxRect = CGRectMake(roundf((allRect.size.width - size.width) / 2) + self.xOffset,
- roundf((allRect.size.height - size.height) / 2) + self.yOffset, size.width, size.height);
+ CGRect boxRect = CGRectMake(round((allRect.size.width - size.width) / 2) + self.xOffset,
+ round((allRect.size.height - size.height) / 2) + self.yOffset, size.width, size.height);
float radius = self.cornerRadius;
CGContextBeginPath(context);
CGContextMoveToPoint(context, CGRectGetMinX(boxRect) + radius, CGRectGetMinY(boxRect));
Please sign in to comment.
Something went wrong with that request. Please try again.