Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sharper HUD border.

  • Loading branch information...
commit 363bfd5aeba6dacde9686954c1cf2444935d5351 1 parent bf5efa2
@matej matej authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 MBProgressHUD.m
View
6 MBProgressHUD.m
@@ -560,11 +560,13 @@ - (void)hideUsingAnimation:(BOOL)animated {
#pragma mark BG Drawing
- (void)drawRect:(CGRect)rect {
+
// Center HUD
CGRect allRect = self.bounds;
// Draw rounded HUD bacgroud rect
- CGRect boxRect = CGRectMake(((allRect.size.width - self.width) / 2) + self.xOffset,
- ((allRect.size.height - self.height) / 2) + self.yOffset, self.width, self.height);
+ CGRect boxRect = CGRectMake(roundf((allRect.size.width - self.width) / 2) + self.xOffset,
+ roundf((allRect.size.height - self.height) / 2) + self.yOffset, self.width, self.height);
+ NSLog(@"%@", NSStringFromCGRect(boxRect));
CGContextRef ctxt = UIGraphicsGetCurrentContext();
[self fillRoundedRect:boxRect inContext:ctxt];
}
Please sign in to comment.
Something went wrong with that request. Please try again.