avm1: Don't fire button events when invisible (fix #1521)
This commit is contained in:
parent
b7d28e5e7e
commit
ab200b6dc0
|
@ -326,6 +326,10 @@ impl<'gc> TDisplayObject<'gc> for Button<'gc> {
|
|||
context: &mut UpdateContext<'_, 'gc, '_>,
|
||||
event: ClipEvent,
|
||||
) -> ClipEventResult {
|
||||
if !self.visible() {
|
||||
return ClipEventResult::NotHandled;
|
||||
}
|
||||
|
||||
if event.propagates() {
|
||||
for child in self.iter_execution_list() {
|
||||
if child.handle_clip_event(context, event) == ClipEventResult::Handled {
|
||||
|
|
|
@ -1774,6 +1774,10 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
|
|||
context: &mut UpdateContext<'_, 'gc, '_>,
|
||||
event: ClipEvent,
|
||||
) -> ClipEventResult {
|
||||
if event.is_button_event() && !self.visible() {
|
||||
return ClipEventResult::NotHandled;
|
||||
}
|
||||
|
||||
if event.propagates() {
|
||||
for child in self.iter_execution_list() {
|
||||
if child.handle_clip_event(context, event) == ClipEventResult::Handled {
|
||||
|
|
Loading…
Reference in New Issue