Skip to content

Index out of range when using background fill or stroke #83

@clo-dan

Description

@clo-dan

When I attempt to set a background fill or stroke, like so:

string.addAttribute(.nantesLabelBackgroundFillColor, value: UIColor.lightGray, range: range)

App crashes with:

Swift/ContiguousArrayBuffer.swift:600: Fatal error: Index out of range

The termination point is Drawing.swift:198, when accessing origins[lineIndex].x:
runBounds.origin.x = origins[lineIndex].x + rect.origin.x + xOffset - fillPadding.left - rect.origin.x

I have verified that the NSRange I provide in the addAttribute call is valid, as I can use the nantesLabelStrikeOut attribute and it works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions