core: Do not include stage transform in DisplayObject::local_to_global_matrix

TODO: Eventually we may want to include the stage transform here,
and the deeper ActionScript APIs transform it to remove the stage
scaling.
This commit is contained in:
Mike Welsh 2021-05-16 15:16:10 -07:00
parent 7784d8c099
commit dfc8c32937
1 changed files with 7 additions and 0 deletions

View File

@ -554,6 +554,13 @@ pub trait TDisplayObject<'gc>:
let mut node = self.parent();
let mut matrix = *self.matrix();
while let Some(display_object) = node {
// TODO: We don't want to include the stage transform because it includes the scale
// mode and alignemnt transform, but the AS APIs expect "global" to be relative to the
// Stage, not final view coordinates.
// I suspect we want this to include the stage transform eventually.
if display_object.as_stage().is_some() {
break;
}
matrix = *display_object.matrix() * matrix;
node = display_object.parent();
}