Let a resize settle through the walk, and drop the stale-answer guard
A resize drew the root outside `redraw_updates`, top-down over a tree with dirty widgets still in it, which is the one entry point `dirty_size_under` was guarding: since `a92c6ac` settles a frame strictly bottom-up, no fuzzer could tell whether that guard still did anything anywhere else. Closing the entry point retires the guard rather than keeping a check for a hole reasoned rather than measured. The root is marked instead, and only where the new output falls outside what its answer holds for. That range is the intersection of everything under it, so admitting the new output says the whole tree still stands, and nothing above the root moved -- the window is no entry to rewrite. Marking it unconditionally would have cost the root its own `Holds`: a leaf root that scales with its box was drawn again on every resize. `dirty_size_under` goes at both call sites. `resize` takes `Widgets` because a mark is what it now leaves behind.
This commit is contained in:
1 parent
25e456e0b5
commit
a0693acc56
3 files changed
+31
-48
No files matched your search
+1
-1
@@ -251,7 +251,7 @@ impl<State: DefaultAppState> AppState for DefaultApp<State> {
|
||||
ui_state.renderer.draw();
|
||||
}
|
||||
WindowEvent::Resized(size) => {
|
||||
render.resize((size.width, size.height));
|
||||
render.resize((size.width, size.height), rsc.widgets_mut());
|
||||
ui_state.renderer.resize(size)
|
||||
}
|
||||
WindowEvent::KeyboardInput { event, .. } => {
|
||||
|
||||
+3
-3
@@ -144,9 +144,9 @@ impl Harness {
|
||||
// bound that comes with `SyncSender` is far past anything a test
|
||||
// leaves unread.
|
||||
let (send, updates) = sync_channel(1024);
|
||||
let rsc = DefaultRsc::init(Arc::new(Queue(send)));
|
||||
let mut rsc = DefaultRsc::init(Arc::new(Queue(send)));
|
||||
let mut render = UiRenderState::new();
|
||||
render.resize(size);
|
||||
render.resize(size, rsc.widgets_mut());
|
||||
Self {
|
||||
rsc,
|
||||
render,
|
||||
@@ -161,7 +161,7 @@ impl Harness {
|
||||
}
|
||||
|
||||
pub fn resize(&mut self, size: impl Into<Vec2>) {
|
||||
self.render.resize(size);
|
||||
self.render.resize(size, self.rsc.widgets_mut());
|
||||
}
|
||||
|
||||
/// Changes a length rule after the fact, the way `.width()` sets one.
|
||||
|
||||
Reference in new issue
Block a user