Skip to content

Commit

Permalink
don't draw shadow for FUIButtons with shadowHeight = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jflinter committed May 27, 2013
1 parent 1e017e0 commit e2316a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/ios/UIImage+FlatUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ + (UIImage *) buttonImageWithColor:(UIColor *)color
CGRect topRect = CGRectMake(shadowInsets.left, shadowInsets.top, topWidth, topHeight);
CGRect bottomRect = CGRectMake(0, 0, totalWidth, totalHeight);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(totalWidth, totalHeight), NO, 0.0f);
[bottomImage drawInRect:bottomRect];
if (!CGRectEqualToRect(bottomRect, topRect)) {
[bottomImage drawInRect:bottomRect];
}
[topImage drawInRect:topRect];
UIImage *buttonImage = UIGraphicsGetImageFromCurrentImageContext();
UIEdgeInsets resizeableInsets = UIEdgeInsetsMake(cornerRadius + shadowInsets.top,
Expand Down

0 comments on commit e2316a5

Please sign in to comment.