Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clamp_window_to_sane_position causes panic #2721

Closed
aevyrie opened this issue Feb 12, 2023 · 1 comment · Fixed by #2722
Closed

clamp_window_to_sane_position causes panic #2721

aevyrie opened this issue Feb 12, 2023 · 1 comment · Fixed by #2722
Labels
bug Something is broken

Comments

@aevyrie
Copy link
Contributor

aevyrie commented Feb 12, 2023

Describe the bug

Demo app panics sporadically, hard to reproduce reliably, but seems to get stuck in a broken state, presumably because the window position/size can be in a malformed state.

thread 'main' panicked at 'assertion failed: min <= max', /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\num\f32.rs:1394:9
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\panicking.rs:584
   1: core::panicking::panic_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library\core\src\panicking.rs:142
   2: core::panicking::panic
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library\core\src\panicking.rs:48
   3: core::f32::impl$0::clamp
             at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\num\f32.rs:1394
   4: emath::pos2::Pos2::clamp
             at .\crates\emath\src\pos2.rs:188
   5: egui_winit::window_settings::WindowSettings::clamp_window_to_sane_position<enum2$<eframe::native::run::UserEvent> >
             at .\crates\egui-winit\src\window_settings.rs:132

To Reproduce
Steps to reproduce the behavior:

  1. Build the egui demo app on windows

Desktop (please complete the following information):

  • OS: Windows 11
  • Version 0.21 - master

Additional context

@aevyrie
Copy link
Contributor Author

aevyrie commented Feb 12, 2023

The assertion is triggering because the RHS of the clamp is smaller than the LHS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant