core: DisplayObject clip depth can only be set on initial placement

This commit is contained in:
Mike Welsh 2022-05-01 18:33:04 -07:00
parent 32252b2ed4
commit 8bf0114fdf
2 changed files with 8 additions and 5 deletions

View File

@ -1274,9 +1274,6 @@ pub trait TDisplayObject<'gc>:
if let Some(color_transform) = &place_object.color_transform {
self.set_color_transform(context.gc_context, &color_transform.clone().into());
}
if let Some(clip_depth) = place_object.clip_depth {
self.set_clip_depth(context.gc_context, clip_depth.into());
}
if let Some(ratio) = place_object.ratio {
if let Some(mut morph_shape) = self.as_morph_shape() {
morph_shape.set_ratio(context.gc_context, ratio);
@ -1327,7 +1324,7 @@ pub trait TDisplayObject<'gc>:
self.set_opaque_background(context.gc_context, color);
}
}
// Purposely omitted: name
// Purposely omitted: name, clip_depth
// These properties are only set on initial placement in `MovieClip::instantiate_child`
// and can not be modified by subsequent PlaceObject tags.
// TODO: Others will go here eventually.

View File

@ -1138,6 +1138,9 @@ impl<'gc> MovieClip<'gc> {
AvmString::new_utf8(context.gc_context, name),
);
}
if let Some(clip_depth) = place_object.clip_depth {
child.set_clip_depth(context.gc_context, clip_depth.into());
}
// Run first frame.
child.construct_frame(context);
@ -3319,6 +3322,8 @@ impl<'a> GotoPlaceObject<'a> {
if place_object.background_color.is_none() {
place_object.background_color = Some(Color::from_rgba(0));
}
// Deliberately omitted:
// clip_depth: Can only be set on initial creation
// `is_visible` purposely skipped; flag carries over during rewind.
}
}
@ -3376,7 +3381,8 @@ impl<'a> GotoPlaceObject<'a> {
cur_place.background_color = next_place.background_color.take();
}
// Deliberately omitted: (can only be set once on instantiation)
// name
// clip_depth
// name:
// TODO: Other stuff.
}
}