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
I'm using an Area to center some ui, with .anchor(CENTER_CENTER, ZERO), which mostly works very well, except the first frame it shows up in the wrong place. This is expected, as only afterwards can it remember the size of the contents and calculate the right position for the ui to appear centered.
However, this first frame with the wrongly positioned center area stays visible until some kind of input event is generated.
For now I worked around this by using:
let r = Area::new("...").anchor(Align2::CENTER_CENTER,Vec2::ZERO).show(...);if(r.response.rect.center() - ctx.available_rect().center()).length_sq() > 1.0{
ctx.request_repaint();}
Would it make sense for egui::Area to automatically request a repaint when after adding the contents the size turned out to be different than what it assumed while chosing the position? (Or maybe some functionality on Response to easliy opt-in to that behaviour?)
The text was updated successfully, but these errors were encountered:
I'm using an
Area
to center some ui, with.anchor(CENTER_CENTER, ZERO)
, which mostly works very well, except the first frame it shows up in the wrong place. This is expected, as only afterwards can it remember the size of the contents and calculate the right position for the ui to appear centered.However, this first frame with the wrongly positioned center area stays visible until some kind of input event is generated.
For now I worked around this by using:
Would it make sense for
egui::Area
to automatically request a repaint when after adding the contents the size turned out to be different than what it assumed while chosing the position? (Or maybe some functionality onResponse
to easliy opt-in to that behaviour?)The text was updated successfully, but these errors were encountered: