diff --git a/core/src/avm2/globals/flash/geom/transform.rs b/core/src/avm2/globals/flash/geom/transform.rs index 2cd6b3ecac9e..432b0775e255 100644 --- a/core/src/avm2/globals/flash/geom/transform.rs +++ b/core/src/avm2/globals/flash/geom/transform.rs @@ -1,7 +1,9 @@ use crate::avm2::globals::slots::flash_geom_color_transform as ct_slots; use crate::avm2::globals::slots::flash_geom_matrix as matrix_slots; use crate::avm2::globals::slots::flash_geom_transform as transform_slots; +use crate::avm2::object::VectorObject; use crate::avm2::parameters::ParametersExt; +use crate::avm2::vector::VectorStorage; use crate::avm2::{Activation, Error, Object, TObject, Value}; use crate::display_object::TDisplayObject; use crate::prelude::{DisplayObject, Matrix, Twips}; @@ -193,12 +195,17 @@ fn matrix3d_to_object<'gc>( matrix: Matrix3D, activation: &mut Activation<'_, 'gc>, ) -> Result, Error<'gc>> { - let args = matrix.raw_data.map(Into::into); + let number = activation.avm2().class_defs().number; + let mut raw_data_storage = VectorStorage::new(16, true, Some(number), activation); + for (i, data) in matrix.raw_data.iter().enumerate() { + raw_data_storage.set(i, Value::Number(*data), activation)?; + } + let vector = VectorObject::from_vector(raw_data_storage, activation)?.into(); let object = activation .avm2() .classes() .matrix3d - .construct(activation, &args)?; + .construct(activation, &[vector])?; Ok(object.into()) }