Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
benguild committed Jan 22, 2017
1 parent 9984b2d commit 3133f1a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions BGTableViewRowActionWithImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ + (instancetype)rowActionWithStyle:(UITableViewRowActionStyle)style title:(NSStr

CGSize drawnTextSize=[title boundingRectWithSize:CGSizeMake(MAXFLOAT, cellHeight) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{ NSFontAttributeName: [UIFont systemFontOfSize:fontSize_actuallyUsedUnderImage] } context:nil].size;

CGFloat imageInsetVertical = [image size].height/2.0;
if ([title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]].length > 0) {
CGFloat imageInsetVertical=([image size].height/2.0);

if ([[title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length])
{
imageInsetVertical=([image size].height+margin_vertical_betweenTextAndImage+drawnTextSize.height)/2.0f;

}

[image drawAtPoint:CGPointMake((frameGuess.width/2.0f)-([image size].width/2.0f), (frameGuess.height/2.0f)-imageInsetVertical)];
Expand Down

0 comments on commit 3133f1a

Please sign in to comment.