wgui: bugfix: always recompute layout before refreshing the component

This allows us to get computed widget boundaries inasted of bogus values
This commit is contained in:
Aleksander 2026-07-03 20:50:09 +02:00
parent 23f1f32d00
commit 1fb2b9ccf2
1 changed files with 3 additions and 2 deletions

View File

@ -187,7 +187,7 @@ pub struct Layout {
pub content_root_node: taffy::NodeId,
pub prev_size: Vec2,
pub content_size: Vec2,
pub content_size: Vec2, // cached value
pub needs_redraw: bool,
pub haptics_triggered: bool,
@ -720,9 +720,10 @@ impl Layout {
pub fn tick(&mut self) -> anyhow::Result<()> {
let mut alterables = EventAlterables::default();
self.animations.tick(&self.state, &mut alterables);
self.process_pending_components();
self.process_pending_widget_ticks(&mut alterables);
self.process_alterables(alterables)?;
self.try_recompute_layout(self.content_size /* cached value */)?;
self.process_pending_components();
Ok(())
}