@@ -10,7 +10,6 @@ @interface MBProgressHUD ()
10
10
11
11
- (void )hideUsingAnimation : (BOOL )animated ;
12
12
- (void )showUsingAnimation : (BOOL )animated ;
13
- - (void )fillRoundedRect : (CGRect)rect inContext : (CGContextRef)context ;
14
13
- (void )done ;
15
14
- (void )updateLabelText : (NSString *)newText ;
16
15
- (void )updateDetailsLabelText : (NSString *)newText ;
@@ -566,21 +565,17 @@ - (void)drawRect:(CGRect)rect {
566
565
// Draw rounded HUD bacgroud rect
567
566
CGRect boxRect = CGRectMake (roundf ((allRect.size .width - self.width ) / 2 ) + self.xOffset ,
568
567
roundf ((allRect.size .height - self.height ) / 2 ) + self.yOffset , self.width , self.height );
569
- NSLog (@" %@ " , NSStringFromCGRect(boxRect));
570
- CGContextRef ctxt = UIGraphicsGetCurrentContext ();
571
- [self fillRoundedRect: boxRect inContext: ctxt];
572
- }
573
-
574
- - (void )fillRoundedRect : (CGRect)rect inContext : (CGContextRef)context {
575
- float radius = 10 .0f ;
568
+ // Corner radius
569
+ float radius = 10 .0f ;
576
570
571
+ CGContextRef context = UIGraphicsGetCurrentContext ();
577
572
CGContextBeginPath (context);
578
573
CGContextSetGrayFillColor (context, 0.0 , self.opacity );
579
- CGContextMoveToPoint (context, CGRectGetMinX (rect ) + radius, CGRectGetMinY (rect ));
580
- CGContextAddArc (context, CGRectGetMaxX (rect ) - radius, CGRectGetMinY (rect ) + radius, radius, 3 * M_PI / 2 , 0 , 0 );
581
- CGContextAddArc (context, CGRectGetMaxX (rect ) - radius, CGRectGetMaxY (rect ) - radius, radius, 0 , M_PI / 2 , 0 );
582
- CGContextAddArc (context, CGRectGetMinX (rect ) + radius, CGRectGetMaxY (rect ) - radius, radius, M_PI / 2 , M_PI, 0 );
583
- CGContextAddArc (context, CGRectGetMinX (rect ) + radius, CGRectGetMinY (rect ) + radius, radius, M_PI, 3 * M_PI / 2 , 0 );
574
+ CGContextMoveToPoint (context, CGRectGetMinX (boxRect ) + radius, CGRectGetMinY (boxRect ));
575
+ CGContextAddArc (context, CGRectGetMaxX (boxRect ) - radius, CGRectGetMinY (boxRect ) + radius, radius, 3 * M_PI / 2 , 0 , 0 );
576
+ CGContextAddArc (context, CGRectGetMaxX (boxRect ) - radius, CGRectGetMaxY (boxRect ) - radius, radius, 0 , M_PI / 2 , 0 );
577
+ CGContextAddArc (context, CGRectGetMinX (boxRect ) + radius, CGRectGetMaxY (boxRect ) - radius, radius, M_PI / 2 , M_PI, 0 );
578
+ CGContextAddArc (context, CGRectGetMinX (boxRect ) + radius, CGRectGetMinY (boxRect ) + radius, radius, M_PI, 3 * M_PI / 2 , 0 );
584
579
CGContextClosePath (context);
585
580
CGContextFillPath (context);
586
581
}
0 commit comments