diff --git a/core/src/ui/render_state.rs b/core/src/ui/render_state.rs index 051f21b..fa79584 100644 --- a/core/src/ui/render_state.rs +++ b/core/src/ui/render_state.rs @@ -1013,9 +1013,16 @@ impl UiRenderState { if at_offer { return; } - // Then in the final box its parent chose from that answer. It is kept - // if it holds there; otherwise its result is the parent's business. - self.draw_inner(id, region, info, None, rsc); + // Then in the final box its parent chose from that answer. That box + // is already placed, so the near edge goes with it: applying the + // widget's own alignment to it again would place its content twice, + // the way it did for a region node under a `Stack` once the stack + // stopped overriding every child's alignment. + let placed_info = DrawInfo { + align: Some(RegionAlign::NEAR), + ..info + }; + self.draw_inner(id, region, placed_info, None, rsc); let active = &self.active[&id]; if (active.size, active.holds) != was { rsc.widgets_mut().needs_redraw.insert(parent); diff --git a/tests/generated.rs b/tests/generated.rs index 47159cd..c7a03c6 100644 --- a/tests/generated.rs +++ b/tests/generated.rs @@ -25,9 +25,11 @@ fn depth() -> usize { env("IRIS_GENERATED_DEPTH", 4) } -/// The seeds the ordinary tests take. Eight that have never failed and one, -/// 86, that a `Scroll` fixed point once settled differently on. -const SEEDS: [u64; 9] = [1, 2, 3, 5, 8, 10, 13, 86, 98]; +/// The seeds the ordinary tests take. Seven that have never failed; 86, +/// which a `Scroll` fixed point once settled differently on; and 20, which +/// caught a locally redrawn widget being placed twice in the box its parent +/// had already placed it in. +const SEEDS: [u64; 10] = [1, 2, 3, 5, 8, 10, 13, 20, 86, 98]; fn check(seed: u64, depth: usize, case: Case) { let grown = plan(seed, depth, &Edits::default());