diff --git a/core/src/avm1/globals/text_format.rs b/core/src/avm1/globals/text_format.rs index 7a41a93ee..28321e313 100644 --- a/core/src/avm1/globals/text_format.rs +++ b/core/src/avm1/globals/text_format.rs @@ -471,7 +471,7 @@ pub fn constructor<'gc>( args: &[Value<'gc>], ) -> Result, Error<'gc>> { if let Some(this) = this.as_text_format_object() { - let mut text_format = TextFormat::default(); + let mut text_format = this.text_format_mut(activation.context.gc_context); set_font( activation, &mut text_format, @@ -537,7 +537,6 @@ pub fn constructor<'gc>( &mut text_format, args.get(12).unwrap_or(&Value::Undefined), )?; - this.set_text_format(activation.context.gc_context, text_format); } Ok(this.into()) diff --git a/core/src/avm1/object/text_format_object.rs b/core/src/avm1/object/text_format_object.rs index d97f3d5bc..11a3fc816 100644 --- a/core/src/avm1/object/text_format_object.rs +++ b/core/src/avm1/object/text_format_object.rs @@ -58,10 +58,6 @@ impl<'gc> TextFormatObject<'gc> { pub fn text_format_mut(&self, gc_context: MutationContext<'gc, '_>) -> RefMut { RefMut::map(self.0.write(gc_context), |o| &mut o.text_format) } - - pub fn set_text_format(&self, gc_context: MutationContext<'gc, '_>, text_format: TextFormat) { - self.0.write(gc_context).text_format = text_format - } } impl<'gc> TObject<'gc> for TextFormatObject<'gc> {