Justify is still justifying the last line of paragraphs #195

Closed
JasonLion opened this Issue Jun 28, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@JasonLion
Contributor

JasonLion commented Jun 28, 2012

Justify is still justifying the last line of some paragraphs, despite pull request #180/ issue #179.

There are two bugs. First, the calculation of isAtEndOfParagraph on line 172 of DTCoreTextLayoutFrame.m is wrong, checking to see if the line starts at the end of the paragraph. Second, a br doesn't end the paragraph but should suppress justification as if it was the end of the paragraph.

Both issues can be solved with the following change to the calculation of isAtEndOfParagraph on line 172 of DTCoreTextLayoutFrame.m:

            BOOL isAtEndOfParagraph    = (currentParagraphRange.location+currentParagraphRange.length <= lineRange.location+lineRange.length || 
                [[_attributedStringFragment string] characterAtIndex:lineRange.location+lineRange.length-1]==0x2028);

Thanks
Jason

@odrobnik

This comment has been minimized.

Show comment Hide comment
@odrobnik

odrobnik Jun 28, 2012

Collaborator

please fix and send pull request.

Collaborator

odrobnik commented Jun 28, 2012

please fix and send pull request.

@JasonLion

This comment has been minimized.

Show comment Hide comment
@JasonLion

JasonLion Jun 28, 2012

Contributor

Submitted a pull request as issue #196.

Contributor

JasonLion commented Jun 28, 2012

Submitted a pull request as issue #196.

@JasonLion JasonLion closed this Jun 28, 2012

odrobnik added a commit that referenced this issue Jun 28, 2012

Merge pull request #196 from JasonLion/master
Resolves issue #195, justification of the final line of paragraphs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment