avm2: Selecting the child of a SimpleButton should select the button, not the child

This fixes ingame menu buttons in BLOCnog
This commit is contained in:
CUB3D 2022-12-11 18:50:33 +00:00 committed by kmeisthax
parent fa44d61bc5
commit 391b3a9dfb
1 changed files with 2 additions and 1 deletions

View File

@ -814,7 +814,8 @@ impl<'gc> TInteractiveObject<'gc> for Avm2Button<'gc> {
.as_interactive()
.and_then(|c| c.mouse_pick(context, point, require_button_mode));
if mouse_pick.is_some() {
return mouse_pick;
// Selecting a child of a button is equivalent to selecting the button itself
return Some((*self).into());
}
}