Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reshaping/relayouting when inputs change lazy #280

Open
nicoburns opened this issue Jul 4, 2024 · 0 comments
Open

Make reshaping/relayouting when inputs change lazy #280

nicoburns opened this issue Jul 4, 2024 · 0 comments

Comments

@nicoburns
Copy link
Contributor

nicoburns commented Jul 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant