Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Place: the dropped-file loop stays out of the web build

aionggf1118d826e4d
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index 928ff210e..c1ca016bd 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -934,11 +934,13 @@ impl DesignApp {
menus::shortcuts(self, ctx);
}
#[cfg(not(target_arch = "wasm32"))]
- let (dropped, pointer) = ctx.input(|i| (i.raw.dropped_files.clone(), i.pointer.hover_pos()));
- for f in dropped {
- let p = f.path().to_string_lossy().to_string();
- if !p.is_empty() {
- let _ = self.open_dropped_at(&p, pointer);
+ {
+ let (dropped, pointer) = ctx.input(|i| (i.raw.dropped_files.clone(), i.pointer.hover_pos()));
+ for f in dropped {
+ let p = f.path().to_string_lossy().to_string();
+ if !p.is_empty() {
+ let _ = self.open_dropped_at(&p, pointer);
+ }
}
}
self.handle_quit(ctx);