From 7a62a8e9ce171bf0cc062c1e33fea8c02eba19d4 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Wed, 27 May 2020 22:47:43 -0400 Subject: [PATCH] Programmatically created text fields get a biased depth. --- core/src/avm1/globals/movie_clip.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/avm1/globals/movie_clip.rs b/core/src/avm1/globals/movie_clip.rs index f9c9846ff..e225276db 100644 --- a/core/src/avm1/globals/movie_clip.rs +++ b/core/src/avm1/globals/movie_clip.rs @@ -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 {