diff --git a/tests/tests/regression_tests.rs b/tests/tests/regression_tests.rs index 72f52893b..f31d84b02 100644 --- a/tests/tests/regression_tests.rs +++ b/tests/tests/regression_tests.rs @@ -439,6 +439,7 @@ swf_tests! { (as3_movieclip_gotoandstop_framescripts2, "avm2/movieclip_gotoandstop_framescripts2", 1), (as3_movieclip_gotoandstop_framescripts_self, "avm2/movieclip_gotoandstop_framescripts_self", 1), (as3_movieclip_gotoandstop_queueing, "avm2/movieclip_gotoandstop_queueing", 2), + (as3_movieclip_hittest, "avm2/movieclip_hittest", 1), (as3_movieclip_next_frame, "avm2/movieclip_next_frame", 5), (as3_movieclip_next_scene, "avm2/movieclip_next_scene", 5), (as3_movieclip_play, "avm2/movieclip_play", 5), diff --git a/tests/tests/swfs/avm2/movieclip_hittest/output.txt b/tests/tests/swfs/avm2/movieclip_hittest/output.txt new file mode 100644 index 000000000..b6b8fb202 --- /dev/null +++ b/tests/tests/swfs/avm2/movieclip_hittest/output.txt @@ -0,0 +1,68 @@ +// Top left just outside of circle. Within BB, but not the actual shape. +// circle.hitTestPoint(234, 122) +true + + +// Bottom right just outside of circle. Within BB, but not the actual shape. +// circle.hitTestPoint(348, 233) +true + + +// Inside the circle. +// circle.hitTestPoint(269, 181) +true + + +// In the gap inside the circle. +// circle.hitTestPoint(313, 183) +true + + +// Outside of the circles BB, to the left. +// circle.hitTestPoint(216, 229) +false + + +// Outside of the circles BB, to the right. +// circle.hitTestPoint(377, 131) +false + + +// Inside the circle within the gap of the big circle. +// circle.hitTestPoint(340, 184) +true + + +// Above and to the right of the circle, not overlapping at all. +// circle.hitTestObject(upper) +false + +// upper.hitTestObject(circle) +false + + +// Below and to the right of the circle, overlapping only with BB. +// circle.hitTestObject(lower) +true + +// lower.hitTestObject(circle) +true + + +// Transforming root +// Inside upper in stage coordinates, but false because hitTestPoint uses root coordinates. +// circle.hitTestPoint(335, 290) +false + +// Just above circle, inside now because of _root._rotation. +// circle.hitTestPoint(234, 105) +true + +// Bottom right just outside of circle. Inside now because of _root._rotation. +// circle.hitTestPoint(348, 233) +true + +// Above and to the right of the circle, Inside now because of _root._rotation. +// circle.hitTestObject(upper) +true + diff --git a/tests/tests/swfs/avm2/movieclip_hittest/test.fla b/tests/tests/swfs/avm2/movieclip_hittest/test.fla new file mode 100644 index 000000000..f67e79114 Binary files /dev/null and b/tests/tests/swfs/avm2/movieclip_hittest/test.fla differ diff --git a/tests/tests/swfs/avm2/movieclip_hittest/test.swf b/tests/tests/swfs/avm2/movieclip_hittest/test.swf new file mode 100644 index 000000000..230218ae9 Binary files /dev/null and b/tests/tests/swfs/avm2/movieclip_hittest/test.swf differ