]> git.mxchange.org Git - simgear.git/commitdiff
Canvas Event System: add missing currentTarget field.
authorThomas Geymayer <tomgey@gmail.com>
Wed, 3 Jul 2013 22:53:49 +0000 (00:53 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Wed, 3 Jul 2013 22:53:49 +0000 (00:53 +0200)
simgear/canvas/CanvasEvent.cxx
simgear/canvas/CanvasEvent.hxx
simgear/canvas/CanvasEventManager.cxx

index d08cfc86f92c2a130730c45355da41d95aceb6a5..414d19938eb775485f3510fa6ec97e829084b2b5 100644 (file)
@@ -62,6 +62,12 @@ namespace canvas
     return target;
   }
 
+  //----------------------------------------------------------------------------
+  ElementWeakPtr Event::getCurrentTarget() const
+  {
+    return current_target;
+  }
+
   //----------------------------------------------------------------------------
   double Event::getTime() const
   {
index 39c65abc5b51ff24325240f009ba720ca36b18e9..c3121269e90c90435e16eab424bac5f34c3ab5d1 100644 (file)
@@ -41,7 +41,8 @@ namespace canvas
       };
 
       Type              type;
-      ElementWeakPtr    target;
+      ElementWeakPtr    target,
+                        current_target;
       double            time;
       bool              propagation_stopped;
 
@@ -55,6 +56,7 @@ namespace canvas
       std::string getTypeString() const;
 
       ElementWeakPtr getTarget() const;
+      ElementWeakPtr getCurrentTarget() const;
 
       double getTime() const;
 
index 3e5c40288917e2bc06b86e8013ce39ab74aa17c5..50e8c49f189ae9c404392ddca87b1bc7c839aa6d 100644 (file)
@@ -299,6 +299,7 @@ namespace canvas
         //mouse_event->delta = it->local_delta;
       }
 
+      event->current_target = el;
       el->handleEvent(event);
 
       if( event->propagation_stopped || !do_bubble )