core: Set clipDepth to 0 when swapDepths affects a clip

This makes "Garfield's Comic Creator" properly show
panels when you close the editor.
This commit is contained in:
Aaron Hill 2023-02-16 19:23:01 -06:00
parent fa6d01c505
commit 3327a9a3fd
1 changed files with 2 additions and 0 deletions

View File

@ -825,10 +825,12 @@ impl<'gc> ChildContainer<'gc> {
) {
let prev_depth = child.depth();
child.set_depth(gc_context, depth);
child.set_clip_depth(gc_context, 0);
child.set_parent(gc_context, Some(parent));
if let Some(prev_child) = self.depth_list.insert(depth, child) {
prev_child.set_depth(gc_context, prev_depth);
prev_child.set_clip_depth(gc_context, 0);
prev_child.set_transformed_by_script(gc_context, true);
self.depth_list.insert(prev_depth, prev_child);