Skip to content

Make reshaping/relayouting when inputs change lazyΒ #280

@nicoburns

Description

@nicoburns

Currently when you call methods like set_text, set_size, and set_metrics_and_size, cosmic-text will eagerly reshape and relayout the Buffer. This is inefficient if multiple changes occur before the new text layout is required. For instance if both the text and the buffer size change, of if the buffer size changes multiple times within a frame.

I think we ought to change to setting a "dirty" flag (or flags - perhaps we could differentiate between when relayout and reshaping is required) when input parameters change. And then have a methods to relayout/reshape on demand which skip doing work if the flag isn't set.

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