Skip to content

Issue #179 #180

Merged
merged 1 commit into from May 4, 2012
View
5 Core/Source/DTCoreTextLayoutFrame.m
@@ -170,6 +170,7 @@ - (void)_buildLinesWithTypesetter
}
BOOL isAtBeginOfParagraph = (currentParagraphRange.location == lineRange.location);
+ BOOL isAtEndOfParagrap = (currentParagraphRange.location+currentParagraphRange.length == lineRange.location-1);
CGFloat offset = 0;
@@ -374,8 +375,8 @@ - (void)_buildLinesWithTypesetter
case kCTJustifiedTextAlignment:
{
- // only justify if the line widht is longer than 60% of the frame to avoid over-stretching
- if (currentLineMetrics.width > 0.6 * _frame.size.width)
+ // only justify if not last line and if the line widht is longer than 60% of the frame to avoid over-stretching
+ if( !isAtEndOfParagraph && (currentLineMetrics.width > 0.60 * _frame.size.width) )
{
// create a justified line and replace the current one with it
CTLineRef justifiedLine = CTLineCreateJustifiedLine(line, 1.0f, availableSpace);
Something went wrong with that request. Please try again.