Skip to content

Commit

Permalink
Area: automatically request a repaint when showing up for the first t…
Browse files Browse the repository at this point in the history
…ime (#866)
  • Loading branch information
emilk authored Nov 7, 2021
1 parent 951ee4e commit 6018c0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions egui/src/containers/area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6018c0e

Please sign in to comment.