]> git.mxchange.org Git - simgear.git/commitdiff
Canvas: Ignore hidden element on event traversal.
authorThomas Geymayer <tomgey@gmail.com>
Sat, 29 Jun 2013 12:12:59 +0000 (14:12 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Sat, 29 Jun 2013 12:12:59 +0000 (14:12 +0200)
simgear/canvas/elements/CanvasElement.cxx

index 7f5ba02d037f18ee7be5c788a53ae560ce91bfe8..3bada0c081d84f78f360cff9a6a16c6db3eb5dde 100644 (file)
@@ -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;
   }
 
   //----------------------------------------------------------------------------