We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78dfde4 commit fde50b5Copy full SHA for fde50b5
egui/src/containers/area.rs
@@ -204,10 +204,13 @@ impl Area {
204
205
let state = ctx.memory().areas.get(id).cloned();
206
let is_new = state.is_none();
207
- let mut state = state.unwrap_or_else(|| State {
208
- pos: default_pos.unwrap_or_else(|| automatic_area_position(ctx)),
209
- size: Vec2::ZERO,
210
- interactable,
+ let mut state = state.unwrap_or_else(|| {
+ ctx.request_repaint(); // if we don't know the previous size we are likely drawing the area in the wrong place
+ State {
+ pos: default_pos.unwrap_or_else(|| automatic_area_position(ctx)),
211
+ size: Vec2::ZERO,
212
+ interactable,
213
+ }
214
});
215
state.pos = new_pos.unwrap_or(state.pos);
216
0 commit comments