mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
#1522 (story titles sometimes run long)
This commit is contained in:
parent
37552d1f5c
commit
c592b05fb4
2 changed files with 9 additions and 1 deletions
|
@ -1810,6 +1810,8 @@ heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|||
|
||||
if (content.length < 50 && [story[@"story_title"] length] < 30) {
|
||||
return height + font.pointSize * 3;
|
||||
} else if (content.length < 50 && [story[@"story_title"] length] >= 30) {
|
||||
return height + font.pointSize * 5;
|
||||
} else if (content.length < 100) {
|
||||
return height + font.pointSize * 5;
|
||||
} else if (self.textSize == FeedDetailTextSizeMedium) {
|
||||
|
|
|
@ -321,8 +321,9 @@ static UIFont *indicatorFont = nil;
|
|||
}
|
||||
CGFloat boundingRows = cell.isShort ? 1.5 : 3;
|
||||
if (!cell.isShort && (self.cell.textSize == FeedDetailTextSizeMedium || self.cell.textSize == FeedDetailTextSizeLong)) {
|
||||
boundingRows = ((r.size.height - 24) / font.pointSize) - 2;
|
||||
boundingRows = MIN(((r.size.height - 24) / font.pointSize) - 2, 4);
|
||||
}
|
||||
cell.storyTitle = [NSString stringWithFormat:@"%@ %@", @(boundingRows), cell.storyTitle];
|
||||
CGSize theSize = [cell.storyTitle
|
||||
boundingRectWithSize:CGSizeMake(rect.size.width, font.pointSize * boundingRows)
|
||||
options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin
|
||||
|
@ -355,6 +356,8 @@ static UIFont *indicatorFont = nil;
|
|||
NSParagraphStyleAttributeName: paragraphStyle}
|
||||
context:nil];
|
||||
|
||||
// CGContextStrokeRect(context, storyTitleFrame);
|
||||
|
||||
if (cell.storyContent) {
|
||||
int storyContentWidth = rect.size.width;
|
||||
CGFloat boundingRows = cell.isShort ? 1.5 : 3;
|
||||
|
@ -398,6 +401,9 @@ static UIFont *indicatorFont = nil;
|
|||
NSForegroundColorAttributeName: textColor,
|
||||
NSParagraphStyleAttributeName: paragraphStyle}
|
||||
context:nil];
|
||||
|
||||
// CGContextStrokeRect(context, CGRectMake(storyTitleX, storyContentY,
|
||||
// rect.size.width - storyTitleX + leftMargin, contentSize.height));
|
||||
}
|
||||
|
||||
// story date
|
||||
|
|
Loading…
Add table
Reference in a new issue