Skip to content

Expose Paragraph.longestLine (width at which we wrapped the longest line) #15300

@Hixie

Description

@Hixie

Currently we expose Paragraph.width, which is the incoming max width constraint when the text wraps. This is the right width to expose for consistent rendering of paragraphs. We also expose Paragraph.intrinsicWidth, which is useful for some effects. But one width we don't expose is the width of the longest line, that is, the actual width that the paragraph was wrapped to. I propose we add this as Paragraph.longestLine, assuming we can compute it with minimal overhead over our current computation.

This is Paragraph.width:

This is Paragraph.longestLine:

Once we have this, we can then add features to the framework to switch whether a particular paragraph is sized based on the width or the longestLine.

cc @jason-simmons

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions