From c372591f36da17bf2fd0d9069ccbd695ef1d95b9 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Sat, 29 Jun 2013 14:12:59 +0200 Subject: [PATCH] Canvas: Ignore hidden element on event traversal. --- simgear/canvas/elements/CanvasElement.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simgear/canvas/elements/CanvasElement.cxx b/simgear/canvas/elements/CanvasElement.cxx index 7f5ba02d..3bada0c0 100644 --- a/simgear/canvas/elements/CanvasElement.cxx +++ b/simgear/canvas/elements/CanvasElement.cxx @@ -209,7 +209,7 @@ namespace canvas //---------------------------------------------------------------------------- bool Element::accept(EventVisitor& visitor) { - if( !_transform.valid() ) + if( !isVisible() ) return false; return visitor.apply(*this); @@ -259,7 +259,7 @@ namespace canvas //---------------------------------------------------------------------------- bool Element::isVisible() const { - return _transform->getNodeMask() != 0; + return _transform.valid() && _transform->getNodeMask() != 0; } //---------------------------------------------------------------------------- -- 2.39.5