Programmatically created text fields get a biased depth.

This commit is contained in:
David Wendt 2020-05-27 22:47:43 -04:00
parent 75aaa49169
commit 7a62a8e9ce
1 changed files with 5 additions and 1 deletions

View File

@ -539,7 +539,11 @@ fn create_text_field<'gc>(
context.gc_context,
&instance_name.coerce_to_string(avm, context)?,
);
movie_clip.add_child_from_avm(context, text_field, depth as Depth);
movie_clip.add_child_from_avm(
context,
text_field,
(depth as Depth).wrapping_add(AVM_DEPTH_BIAS),
);
text_field.post_instantiation(avm, context, text_field, None, true);
if avm.current_swf_version() >= 8 {