rust 2024

This commit is contained in:
Aleksander
2025-06-17 18:29:57 +02:00
parent f05d3a8251
commit cc26831e35
8 changed files with 47 additions and 42 deletions

View File

@@ -1,10 +1,10 @@
#[derive(rust_embed::Embed)]
#[folder = "src/gui/assets/"]
#[folder = "src/assets/"]
pub struct GuiAsset;
impl wgui::assets::AssetProvider for GuiAsset {
fn load_from_path(&mut self, path: &str) -> anyhow::Result<Vec<u8>> {
match GuiAsset::get(path) {
match Self::get(path) {
Some(data) => Ok(data.data.to_vec()),
None => anyhow::bail!("embedded file {} not found", path),
}

View File

@@ -136,7 +136,7 @@ impl OverlayRenderer for GuiPanel {
_alpha: f32,
) -> anyhow::Result<bool> {
self.context.update_viewport(tgt.extent_u32arr(), 1.0)?;
self.layout.update(tgt.extent_vec2(), self.timestep.alpha);
self.layout.update(tgt.extent_vec2(), self.timestep.alpha)?;
let mut cmd_buf = app
.gfx