avm1: Allow string paths in hitTest (fix #1559)

This commit is contained in:
Mike Welsh 2020-11-17 18:55:59 -08:00
parent 1674132b36
commit 4c01022a38
4 changed files with 14 additions and 5 deletions

View File

@ -138,11 +138,8 @@ pub fn hit_test<'gc>(
return Ok(ret.into()); return Ok(ret.into());
} }
} else if args.len() == 1 { } else if args.len() == 1 {
let other = args let other = activation
.get(0) .resolve_target_display_object(movie_clip.into(), args.get(0).unwrap().clone())?;
.unwrap()
.coerce_to_object(activation)
.as_display_object();
if let Some(other) = other { if let Some(other) = other {
return Ok(other return Ok(other
.world_bounds() .world_bounds()

View File

@ -66,3 +66,15 @@ true
// circle.hitTest(upper) // circle.hitTest(upper)
true true
// String path, below and to the right of the circle, overlapping only with BB.
// circle.hitTest('_root.lower')
true
// String path, above and to the right of the circle.
// circle.hitTest('../upper')
true
// String path, /
// circle.hitTest('/')
true