core: Propagate events to children in the reverse order

...when this is not an event type used by Buttons. Fixes #8357.
This commit is contained in:
Toad06 2023-01-24 21:15:01 +01:00
parent f213ec40fc
commit d7c2d60899
1 changed files with 6 additions and 1 deletions

View File

@ -180,7 +180,12 @@ pub trait TInteractiveObject<'gc>:
) -> ClipEventResult {
if event.propagates() {
if let Some(container) = self.as_displayobject().as_container() {
for child in container.iter_render_list() {
let children = if event.is_button_event() {
container.iter_render_list().collect::<Vec<_>>()
} else {
container.iter_render_list().rev().collect::<Vec<_>>()
};
for child in children {
if let Some(interactive) = child.as_interactive() {
if interactive.handle_clip_event(context, event) == ClipEventResult::Handled
{