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

Change opt_color of a BufferLine without triggering a reshape / relayout #69

Open
hecrj opened this issue Feb 3, 2023 · 1 comment · May be fixed by #101
Open

Change opt_color of a BufferLine without triggering a reshape / relayout #69

hecrj opened this issue Feb 3, 2023 · 1 comment · May be fixed by #101

Comments

@hecrj
Copy link
Contributor

hecrj commented Feb 3, 2023

The main use case here is being able to reuse a Buffer both for layout and drawing. iced does not know the color of the text during layout.

Color doesn't really affect anything but drawing, right? It seems it'd make more sense to provide a list of color spans as an argument to draw? Or maybe we could change BufferLine::set_attrs_list to not trigger a reset if only the colors differ?

if attrs_list != self.attrs_list {
self.attrs_list = attrs_list;
self.reset();
true

@genusistimelord
Copy link
Contributor

I would say we shouldn't need to rerun the layout if the colors change since this doesn't affect the layout itself. The only parts in Attr that affect the layout would be those that would be family, stretch, style and weight. Meta And Color should just be Update-able somehow.

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

Successfully merging a pull request may close this issue.

2 participants