From 6018c0e1944423734e9ec16270f5c2fa01dcd5ea Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 7 Nov 2021 21:14:13 +0100 Subject: [PATCH] Area: automatically request a repaint when showing up for the first time (#866) --- egui/src/containers/area.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/egui/src/containers/area.rs b/egui/src/containers/area.rs index 77ae49550..cb5fc831a 100644 --- a/egui/src/containers/area.rs +++ b/egui/src/containers/area.rs @@ -203,6 +203,9 @@ impl Area { let state = ctx.memory().areas.get(id).cloned(); let is_new = state.is_none(); + if is_new { + ctx.request_repaint(); // if we don't know the previous size we are likely drawing the area in the wrong place} + } let mut state = state.unwrap_or_else(|| State { pos: default_pos.unwrap_or_else(|| automatic_area_position(ctx)), size: Vec2::ZERO,