1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Area: automatically request a repaint when showing up for the first time (#866)

This commit is contained in:
Emil Ernerfeldt
2021-11-07 21:14:13 +01:00
committed by GitHub
parent 951ee4e142
commit 6018c0e194

View File

@@ -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,