Skip to content

Commit

Permalink
Fixed an issue in the User Contributed repo which caused author names…
Browse files Browse the repository at this point in the history
… to not be truncated when there's not enough space
  • Loading branch information
Kapeli committed Jun 5, 2017
1 parent e5fc4da commit 3482d8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dash/DHRightDetailLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ - (void)drawRect:(CGRect)rect
}
if(self.subtitle.length)
{
NSMutableParagraphStyle *paragraph = NSMutableParagraphStyle.new;
paragraph.lineBreakMode = NSLineBreakByTruncatingTail;
rect = self.bounds;
rect.origin.y += 24;
rect.size.width -= self.maxRightDetailWidth;
NSString *subtitle = self.subtitle;
if(self.authorLinkHref)
{
Expand All @@ -61,7 +64,7 @@ - (void)drawRect:(CGRect)rect
}
// else
// {
[subtitle drawInRect:rect withAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:11], NSForegroundColorAttributeName: [UIColor colorWithRed:142.0/255.0 green:142.0/255.0 blue:147.0/255.0 alpha:1.0]}];
[subtitle drawInRect:rect withAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:11], NSParagraphStyleAttributeName: paragraph, NSForegroundColorAttributeName: [UIColor colorWithRed:142.0/255.0 green:142.0/255.0 blue:147.0/255.0 alpha:1.0]}];
// }
}
}
Expand Down

0 comments on commit 3482d8f

Please sign in to comment.