Skip to content

Endless recursive call #2

@Lessica

Description

@Lessica

In TKELayoutManager.m:

// The additional indent is the distance from the first to the last character
leftInset += [self locationForGlyphAtIndex:firstTextGlyphIndex].x - [self locationForGlyphAtIndex:firstGlyphIndex].x;

But, -[NSLayoutManager locationForGlyphAtIndex:] may call -[NSTextContainer lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:] by default.

In TKETextContainer.m:

UIEdgeInsets insets = [(TKELayoutManager *)self.layoutManager insetsForLineStartingAtCharacterIndex: characterIndex];
rect.size.width -= insets.left + insets.right;
return rect;

Which causes endless recursive call and crashes the application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions