-
Notifications
You must be signed in to change notification settings - Fork 108
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
Masonry: Request layout does not implicitly start a redraw #301
Comments
Maybe we can request a paint, when the layout pass needs it? So that when layout doesn't change anything that requires a repaint, we can save a paint pass? But maybe this is also too much of a footgun, and a layout request should just imply a paint request. |
That's a subtly different question, I think. This is about scheduling a layout to actually happen. Currently, that is the next time a paint is requested, because only needs_paint sends Winit a redraw requested command - handling that is when the layout/paint pass actually happens |
Yeah probably a subtly different question. I do think though, it's not necessarily a footgun when we have a good testsuite. One just needs to remember what may really have changed and request all the passes that are necessary for that. And when one of the passes requires a further pass, that should be reflected in that pass. I just checked, currently at least a layout pass implies a repaint: xilem/crates/masonry/src/widget/widget_pod.rs Lines 848 to 849 in aaeeadb
But when checking e.g. xilem/crates/masonry/src/widget/image.rs Lines 59 to 64 in aaeeadb
this could indeed be a footgun, when the |
If, when responding to an event, you change state which will be updated in layout, the way you have to handle that is:
e.g.
xilem/crates/masonry/src/widget/textbox.rs
Lines 182 to 184 in aaeeadb
Otherwise, the update does not actually get drawn. This is not very ergonomic, and is a significant footgun in the masonry layer that this does not happen. We need to find a solution here. That might just be that
request_layout
also requests a paint; this should be at the right level in the passesThe text was updated successfully, but these errors were encountered: