Skip to content

Suboptimal wrapping due to rounding #208

@benoitkugler

Description

@benoitkugler

It is a bit unfortunate that LineWrapper.WrapNextLine and LineWrapper.WrapParagraph take an int for the maximum width.

In one of my use case, the precision loss matters as an unexpected line break is produced by go-text. More precisely, I have a single run of text of advance 45.5 and a max width of 45.8, so that the run is broken by go-text while it should simply fit on the first line.

I think we should change the type used internally, expose two new methods taking a fixed.26_6, and (perhaps) deprecate the current method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions