From 8b81fd5bb9bae1ae323ee2ce60429b625a0b6b97 Mon Sep 17 00:00:00 2001 From: galister <22305755+galister@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:00:26 +0900 Subject: [PATCH] redraw if run_ref failed --- src/backend/uidev/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/uidev/mod.rs b/src/backend/uidev/mod.rs index 6b9a667..3879db6 100644 --- a/src/backend/uidev/mod.rs +++ b/src/backend/uidev/mod.rs @@ -186,7 +186,9 @@ pub fn uidev_run(panel_name: &str) -> anyhow::Result<()> { .create_command_buffer(CommandBufferUsage::OneTimeSubmit) .unwrap(); cmd_buf.begin_rendering(target).unwrap(); - let _ = cmd_buf.run_ref(&preview.pass); + if cmd_buf.run_ref(&preview.pass).is_err() { + window.request_redraw(); + } cmd_buf.end_rendering().unwrap(); let command_buffer = cmd_buf.build().unwrap();