Prevent z-index id shuffle when number of z-indicies in the scene change

This commit is contained in:
Julia 2024-01-29 11:49:57 -05:00 committed by Julia
parent 849a1324f7
commit 941e838be9
3 changed files with 44 additions and 10 deletions

View file

@ -328,7 +328,13 @@ impl Element for AnyView {
element.draw(bounds.origin, bounds.size.into(), cx);
}
state.next_stacking_order_id = cx.window.next_frame.next_stacking_order_id;
state.next_stacking_order_id = cx
.window
.next_frame
.next_stacking_order_ids
.last()
.copied()
.unwrap();
state.cache_key = Some(ViewCacheKey {
bounds,
stacking_order: cx.stacking_order().clone(),