Fix the wgpu child window example (#3989)

This commit is contained in:
Christian Wyglendowski authored and GitHub committed 2025-04-16 08:40:56 -07:00
1 parent 1001d78c7f
commit a9468429d7
1 file changed
+10 -7
+10 -7
View File
@@ -52,12 +52,15 @@ fn app() -> Element {
} = event
{
let ctx = graphics_resources.value();
ctx.as_ref().unwrap().with_resources(|srcs| {
let mut cfg = srcs.config.clone();
cfg.width = new_size.width;
cfg.height = new_size.height;
srcs.surface.configure(&srcs.device, &cfg);
});
if let Some(ctx_ref) = ctx.as_ref() {
ctx_ref.with_resources(|srcs| {
let mut cfg = srcs.config.clone();
cfg.width = new_size.width;
cfg.height = new_size.height;
srcs.surface.configure(&srcs.device, &cfg);
});
}
window().window.request_redraw();
}
});
@@ -71,7 +74,7 @@ fn app() -> Element {
justify_content: "center",
align_items: "center",
font_size: "20px",
div { "text overlaied on wgpu surface!" }
div { "text overlaid on a wgpu surface!" }
}
}
}