Closed kristofferpeterhansel closed 1 month ago
Thanks for your bug report.
It looks like it panics because it cannot convert cast() one of the rectangle in this function:
https://github.com/slint-ui/slint/blob/v1.4.1/internal/core/software_renderer.rs#L1129-L1133
It is casting between i16 and f32. So it looks like there is so this should be only a problem if we have very high values (but i guess your screen is smaller than 32767 width or height)
But it is true that we might have a problem if the code had some division by zero in the .slint code (eg https://github.com/slint-ui/slint/issues/3982) or maybe the size got too big. But I couldn't reproduce the problem with a simple app.
Do you know the size and position of your Popup?
The position should be on 0 x and y. With a width of 320 and a height of 240. I'll have to double check when I get home. But I believe I even have it hard-coded here. Since there is no way to get that dimension from inside the component I make it in (that I am aware of)
Haha. Looks like I made the classic mistake of over-thinking is issue.
After trying to build a simplified example for a while I came down to the one thing I didn't think it could be. Setting the max value of the Slider component to zero.
So trying to render this will consistently panic on my ESP32 device (but not on macOS):
Slider { minimum: 0; maximum: 0;}
In this case the value is calculated in the slint file based on other values. And it does make sense to not be able to select a value.
I can see how this Slider might cause a division by zero. But I still couldn't reproduce a crash. when i tried locally
closing this issue since i couldn't reproduce.
Platform
ESP32 using esp-idf (so not no_std. Although enabling std feature in slint still causes issues).
Running it locally on macOS does not display the same issue.
Description
I've been trying to get an slint UI working on an ESP32 device (M5Stack Core2 v1.1). And while it is currently quite slow - and has some touch input issues with some controls. It works well enough at least for prototyping a UI.
But a recent change in the UI seems to have started to trigger a panic with no obvious reason I can find. From inside a component I am trying to use PopupWindow to create basically a full-screen overlay for some temporary input. And it seems to have been working. Until some change started to trigger this issue. But I have so far not been able to isolate something specific that provokes it.