Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #167 from Club15CC/15cc-additions

Adds roundedCorner property
  • Loading branch information...
commit bb4a35b0082135c4566830e84b6081ba5f4eccd9 2 parents c8e51ec + c56e789
@matej matej authored
Showing with 8 additions and 1 deletion.
  1. +6 −0 MBProgressHUD.h
  2. +2 −1  MBProgressHUD.m
View
6 MBProgressHUD.h
@@ -344,6 +344,12 @@ typedef void (^MBProgressHUDCompletionBlock)();
*/
@property (assign) float margin;
+/**
+ * The corner radius for th HUD
+ * Defaults to 10.0
+ */
+@property (assign) float cornerRadius;
+
/**
* Cover the HUD background view with a radial gradient.
*/
View
3  MBProgressHUD.m
@@ -189,6 +189,7 @@ - (id)initWithFrame:(CGRect)frame {
self.yOffset = 0.0f;
self.dimBackground = NO;
self.margin = 20.0f;
+ self.cornerRadius = 10.0f;
self.graceTime = 0.0f;
self.minShowTime = 0.0f;
self.removeFromSuperViewOnHide = NO;
@@ -639,7 +640,7 @@ - (void)drawRect:(CGRect)rect {
// 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);
- float radius = 10.0f;
+ float radius = self.cornerRadius;
CGContextBeginPath(context);
CGContextMoveToPoint(context, CGRectGetMinX(boxRect) + radius, CGRectGetMinY(boxRect));
CGContextAddArc(context, CGRectGetMaxX(boxRect) - radius, CGRectGetMinY(boxRect) + radius, radius, 3 * (float)M_PI / 2, 0, 0);
Please sign in to comment.
Something went wrong with that request. Please try again.