Closed pepperoni505 closed 2 months ago
Adding the following functions to DemoViewer in the sample results in the program panicking: assertion failed: max_rect.is_finite() from egui-0.28.1\src\layout.rs:420:9
DemoViewer
assertion failed: max_rect.is_finite()
egui-0.28.1\src\layout.rs:420:9
fn has_footer(&mut self, node: &DemoNode) -> bool { true } fn show_footer( &mut self, node: NodeId, inputs: &[InPin], outputs: &[OutPin], ui: &mut Ui, scale: f32, snarl: &mut Snarl<DemoNode>, ) { ui.button("test"); }
The issue stems from these lines which pass infinity as a parameter to the rect allocation: https://github.com/zakarumych/egui-snarl/blob/b61a98041ad67ab2e9eaabf8cf72352efab81d86/src/ui.rs#L1391-L1392 https://github.com/zakarumych/egui-snarl/blob/b61a98041ad67ab2e9eaabf8cf72352efab81d86/src/ui.rs#L1131-L1134
A suitable (untested!) solution could be to change f32::INFINITY to f32::MAX
f32::INFINITY
f32::MAX
Thank you for making this issue. It is the same error that was fixed for a header. Caused by new debug assert in egui v0.28.
I fixed in 9aec7c0f395b69823c0d46bf0bba6721cf224386
Adding the following functions to
DemoViewer
in the sample results in the program panicking:assertion failed: max_rect.is_finite()
fromegui-0.28.1\src\layout.rs:420:9
The issue stems from these lines which pass infinity as a parameter to the rect allocation: https://github.com/zakarumych/egui-snarl/blob/b61a98041ad67ab2e9eaabf8cf72352efab81d86/src/ui.rs#L1391-L1392 https://github.com/zakarumych/egui-snarl/blob/b61a98041ad67ab2e9eaabf8cf72352efab81d86/src/ui.rs#L1131-L1134
A suitable (untested!) solution could be to change
f32::INFINITY
tof32::MAX