From 597575069db350fa27ec14ddf8b330bcd8786bf6 Mon Sep 17 00:00:00 2001 From: Ben Guild Date: Mon, 28 Dec 2015 23:41:14 -0500 Subject: [PATCH] Fixing previous RTL addition by @acMaia. 048da22 --- BGTableViewRowActionWithImage.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGTableViewRowActionWithImage.m b/BGTableViewRowActionWithImage.m index fd742e5..22a4fdf 100644 --- a/BGTableViewRowActionWithImage.m +++ b/BGTableViewRowActionWithImage.m @@ -43,7 +43,7 @@ + (instancetype)rowActionWithStyle:(UITableViewRowActionStyle)style title:(NSStr CGSize drawnTextSize=[title boundingRectWithSize:CGSizeMake(MAXFLOAT, cellHeight) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{ NSFontAttributeName: [UIFont systemFontOfSize:fontSize_actuallyUsedUnderImage] } context:nil].size; [image drawAtPoint:CGPointMake((frameGuess.width/2.0f)-([image size].width/2.0f), (frameGuess.height/2.0f)-[image size].height-(margin_vertical_betweenTextAndImage/2.0f)+2.0f)]; - [title drawInRect:CGRectMake((frameGuess.width/2.0f)-(drawnTextSize.width/2.0f), (frameGuess.height/2.0f)+(margin_vertical_betweenTextAndImage/2.0f)+2.0f, frameGuess.width, frameGuess.height) withAttributes:@{ NSFontAttributeName: [UIFont systemFontOfSize:fontSize_actuallyUsedUnderImage], NSForegroundColorAttributeName: titleColor }]; + [title drawInRect:CGRectMake(((frameGuess.width/2.0f)-(drawnTextSize.width/2.0f))*([[UIApplication sharedApplication] userInterfaceLayoutDirection]==UIUserInterfaceLayoutDirectionRightToLeft ? -1 : 1), (frameGuess.height/2.0f)+(margin_vertical_betweenTextAndImage/2.0f)+2.0f, frameGuess.width, frameGuess.height) withAttributes:@{ NSFontAttributeName: [UIFont systemFontOfSize:fontSize_actuallyUsedUnderImage], NSForegroundColorAttributeName: titleColor }]; [rowAction setBackgroundColor:[UIColor colorWithPatternImage:UIGraphicsGetImageFromCurrentImageContext()]]; UIGraphicsEndImageContext();