Skip to content

Commit e2316a5

Browse files
committed
don't draw shadow for FUIButtons with shadowHeight = 0
1 parent 1e017e0 commit e2316a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Classes/ios/UIImage+FlatUI.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ + (UIImage *) buttonImageWithColor:(UIColor *)color
4444
CGRect topRect = CGRectMake(shadowInsets.left, shadowInsets.top, topWidth, topHeight);
4545
CGRect bottomRect = CGRectMake(0, 0, totalWidth, totalHeight);
4646
UIGraphicsBeginImageContextWithOptions(CGSizeMake(totalWidth, totalHeight), NO, 0.0f);
47-
[bottomImage drawInRect:bottomRect];
47+
if (!CGRectEqualToRect(bottomRect, topRect)) {
48+
[bottomImage drawInRect:bottomRect];
49+
}
4850
[topImage drawInRect:topRect];
4951
UIImage *buttonImage = UIGraphicsGetImageFromCurrentImageContext();
5052
UIEdgeInsets resizeableInsets = UIEdgeInsetsMake(cornerRadius + shadowInsets.top,

0 commit comments

Comments
 (0)