-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
A-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorP-CrashA sudden unexpected crashA sudden unexpected crashS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Description
Bevy version and features
0.18
What you did
Attempt to set a scale factor override value through bevy inspector egui by changing the None value to Some(x).
What went wrong
When changing the None to Some, the scale factor value uses the f32 default of 0. This triggers an assert inside dpi, skipping the usual bevy error handling machinery and panicing the process.
While it's unlikely that the user intentionally wants a zero scale factor, editor tools like inspector egui or the upcoming entity inspector make scenarios like this much more common. The engine also shouldn't crash due to such a minor misconfiguration.
Possible solutions
- Upstream a change to
dpithat won't panic, eg by using Option/Result. - Use the same validation function
dpiuses to ensure we only pass "good" scale factor values to the function. Possibly defaulting to 1.0 and logging an error? - Somehow tie this error into using Bevys error handling machinery so it's not a straight panic.
- ?
Additional information
thread 'main' (1375470) panicked at /home/choc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dpi-0.1.2/src/lib.rs:563:9:
assertion failed: validate_scale_factor(scale_factor)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_winit::system::changed_windows`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorP-CrashA sudden unexpected crashA sudden unexpected crashS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong