We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When the window becomes smaller than the inited screen size, pyxel fails with
init
pyo3_runtime.PanicException: attempt to divide by zero
This happens due to screen_scale:
screen_scale
pyxel/lib/engine/src/sdl2.rs
Lines 395 to 399 in 0784e5f
0
This then causes the division by zero here:
Lines 413 to 414 in 0784e5f
If its relevant, I'm on Linux, though I doubt this is platform specific.
Ideally when there isnt enough space, the game view inside the window would shrink to fit the window size.
The text was updated successfully, but these errors were encountered:
Thank you for the report.
I expected this issue was prevented by this code:
sdl_canvas .window_mut() .set_minimum_size(width, height) .unwrap();
So does it mean there's some environment that ignores minimum size setting? I continue checking.
Sorry, something went wrong.
In the latest Pyxel, I couldn't reproduce this error on Ubuntu. So let me close.
No branches or pull requests
When the window becomes smaller than the
init
ed screen size, pyxel fails withThis happens due to
screen_scale
:pyxel/lib/engine/src/sdl2.rs
Lines 395 to 399 in 0784e5f
Here,
screen_scale
can be0
when there is not enough window space vertically or horizontally.This then causes the division by zero here:
pyxel/lib/engine/src/sdl2.rs
Lines 413 to 414 in 0784e5f
If its relevant, I'm on Linux, though I doubt this is platform specific.
Ideally when there isnt enough space, the game view inside the window would shrink to fit the window size.
The text was updated successfully, but these errors were encountered: