Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #180 from drd27/master

Issue #179
  • Loading branch information...
commit 35186f42f550ed3af59dee42db5aec9bef4f285c 2 parents 4ae0d3d + 64889ee
@Cocoanetics authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 Core/Source/DTCoreTextLayoutFrame.m
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);
Please sign in to comment.
Something went wrong with that request. Please try again.