Skip to content

Commit 6018c0e

Browse files
authored
Area: automatically request a repaint when showing up for the first time (#866)
1 parent 951ee4e commit 6018c0e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

egui/src/containers/area.rs

+3
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ impl Area {
203203

204204
let state = ctx.memory().areas.get(id).cloned();
205205
let is_new = state.is_none();
206+
if is_new {
207+
ctx.request_repaint(); // if we don't know the previous size we are likely drawing the area in the wrong place}
208+
}
206209
let mut state = state.unwrap_or_else(|| State {
207210
pos: default_pos.unwrap_or_else(|| automatic_area_position(ctx)),
208211
size: Vec2::ZERO,

0 commit comments

Comments
 (0)