fix DashFrontend not updating
[skip ci]
This commit is contained in:
@@ -106,7 +106,8 @@ impl DashFrontend {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_layout(&mut self) -> anyhow::Result<()> {
|
fn update(&mut self) -> anyhow::Result<()> {
|
||||||
|
log::info!("update layout");
|
||||||
self.inner.update(DASH_RES_VEC2.x, DASH_RES_VEC2.y, 0.0)
|
self.inner.update(DASH_RES_VEC2.x, DASH_RES_VEC2.y, 0.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +129,7 @@ impl OverlayBackend for DashFrontend {
|
|||||||
self.interaction_transform = Some(ui_transform(DASH_RES_U32A));
|
self.interaction_transform = Some(ui_transform(DASH_RES_U32A));
|
||||||
|
|
||||||
if self.inner.layout.content_size.x * self.inner.layout.content_size.y != 0.0 {
|
if self.inner.layout.content_size.x * self.inner.layout.content_size.y != 0.0 {
|
||||||
self.update_layout()?;
|
self.update()?;
|
||||||
self.initialized = true;
|
self.initialized = true;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -161,6 +162,10 @@ impl OverlayBackend for DashFrontend {
|
|||||||
.layout
|
.layout
|
||||||
.update(DASH_RES_VEC2, self.timestep.alpha)?;
|
.update(DASH_RES_VEC2, self.timestep.alpha)?;
|
||||||
|
|
||||||
|
if let Err(e) = self.update() {
|
||||||
|
log::error!("uncaught exception: {e:?}");
|
||||||
|
}
|
||||||
|
|
||||||
let globals = self.inner.layout.state.globals.clone(); // sorry
|
let globals = self.inner.layout.state.globals.clone(); // sorry
|
||||||
let mut globals = globals.get();
|
let mut globals = globals.get();
|
||||||
|
|
||||||
@@ -173,7 +178,7 @@ impl OverlayBackend for DashFrontend {
|
|||||||
self.context.draw(
|
self.context.draw(
|
||||||
&globals.font_system,
|
&globals.font_system,
|
||||||
&mut app.wgui_shared,
|
&mut app.wgui_shared,
|
||||||
&mut rdr.cmd_buf_single(),
|
rdr.cmd_buf_single(),
|
||||||
&primitives,
|
&primitives,
|
||||||
)?;
|
)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user