core: Stub out MovieClip.getRect

Just defer to getBounds for now. TODO: getRect should return bounds
ignoring strokes, so in reality it is <= getBounds.
This commit is contained in:
Mike Welsh 2020-02-24 13:20:30 -08:00
parent 993c05cf19
commit d8079ac04a
1 changed files with 12 additions and 0 deletions

View File

@ -145,6 +145,7 @@ pub fn create_proto<'gc>(
"getBytesTotal" => get_bytes_total,
"getDepth" => get_depth,
"getNextHighestDepth" => get_next_highest_depth,
"getRect" => get_rect,
"globalToLocal" => global_to_local,
"gotoAndPlay" => goto_and_play,
"gotoAndStop" => goto_and_stop,
@ -743,6 +744,17 @@ fn get_bounds<'gc>(
}
}
fn get_rect<'gc>(
movie_clip: MovieClip<'gc>,
avm: &mut Avm1<'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<ReturnValue<'gc>, Error> {
// TODO: This should get the bounds ignoring strokes. Always equal to or smaller than getBounds.
// Just defer to getBounds for now. Will have to store edge_bounds vs. shape_bounds in Graphic.
get_bounds(movie_clip, avm, context, args)
}
fn global_to_local<'gc>(
movie_clip: MovieClip<'gc>,
avm: &mut Avm1<'gc>,