You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug ui.available_size(), ctx.screen_rect() and several other properties report arbitrarily large, yet finite numbers for the first one or two frames after starting the native application. I have an image viewer that uses the available size to decide how many images to load from disk. This causes the app to try and load an unreasonably large number of images from the disk, and crash by trying to allocate too much memory.
I had been using the 0.28.1 version for a while, without this issue. I ran into the issue when I tried to update to 0.31.0 to try out the Scene feature.
To Reproduce
Steps to reproduce the behavior:
Start a native eframe.
Inside the update, in the eframe::App trait implementation, create a panel, and print ui.available_size(). This should be a number much larger than the screen.
Using .with_clamp_size_to_monitor_size(true) with the ViewportBuilder doesn't fix the problem either.
Expected behavior
Either the available space is clamped to the screen size, or if egui needs a couple of frames to calculate the available size, it would be nice to have a way to ask if things are ready, i.e. if the reported size is actually valid.
Screenshots
In the snippet below, render_grid_preview tries to estimate the files that need to be read and rendered.
Desktop (please complete the following information):
OS: Ubuntu
Version 0.31.0
Additional context
I am currently checking whether the frame is ready with proper sizes, by checking frame.info().cpu_usage.is_some(). But I am not sure if this makes any sense.
The text was updated successfully, but these errors were encountered:
Describe the bug
ui.available_size()
,ctx.screen_rect()
and several other properties report arbitrarily large, yet finite numbers for the first one or two frames after starting the native application. I have an image viewer that uses the available size to decide how many images to load from disk. This causes the app to try and load an unreasonably large number of images from the disk, and crash by trying to allocate too much memory.I had been using the
0.28.1
version for a while, without this issue. I ran into the issue when I tried to update to 0.31.0 to try out theScene
feature.To Reproduce
Steps to reproduce the behavior:
update
, in theeframe::App
trait implementation, create a panel, and printui.available_size()
. This should be a number much larger than the screen..with_clamp_size_to_monitor_size(true)
with theViewportBuilder
doesn't fix the problem either.Expected behavior
Either the available space is clamped to the screen size, or if egui needs a couple of frames to calculate the available size, it would be nice to have a way to ask if things are ready, i.e. if the reported size is actually valid.
Screenshots
In the snippet below,
render_grid_preview
tries to estimate the files that need to be read and rendered.For the first 1 or two frames, control flow goes into the
else
branch and prints the following:Desktop (please complete the following information):
Additional context
I am currently checking whether the frame is ready with proper sizes, by checking
frame.info().cpu_usage.is_some()
. But I am not sure if this makes any sense.The text was updated successfully, but these errors were encountered: