From: Thomas Geymayer Date: Sat, 29 Jun 2013 12:12:59 +0000 (+0200) Subject: Canvas: Ignore hidden element on event traversal. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c372591f36da17bf2fd0d9069ccbd695ef1d95b9;p=simgear.git Canvas: Ignore hidden element on event traversal. --- 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; } //----------------------------------------------------------------------------