Skip to content

Commit 315b55c

Browse files
committed
Fix panic when requesting negatively sized space from egui
Addresses egui #4478 (emilk/egui#4478)
1 parent 59bb5df commit 315b55c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/bevy_editor_pls_core/src/editor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ impl Editor {
457457
}
458458
window.show(ctx, |ui| {
459459
self.editor_window_inner(world, internal_state, floating_window.window, ui);
460-
ui.allocate_space(ui.available_size() - (5.0, 5.0).into());
460+
let desired_size = (ui.available_size() - (5.0, 5.0).into()).max((0.0, 0.0).into());
461+
ui.allocate_space(desired_size);
461462
});
462463

463464
if !open {

0 commit comments

Comments
 (0)