Permalink
Browse files

Sharper HUD border.

  • Loading branch information...
1 parent bf5efa2 commit 363bfd5aeba6dacde9686954c1cf2444935d5351 @matej matej committed Apr 29, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 MBProgressHUD.m
View
@@ -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];
}

0 comments on commit 363bfd5

Please sign in to comment.