From: Thomas Geymayer Date: Wed, 3 Jul 2013 22:53:49 +0000 (+0200) Subject: Canvas Event System: add missing currentTarget field. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=943efbb3ed37afda79a761a643030647e85278c0;p=simgear.git Canvas Event System: add missing currentTarget field. --- diff --git a/simgear/canvas/CanvasEvent.cxx b/simgear/canvas/CanvasEvent.cxx index d08cfc86..414d1993 100644 --- a/simgear/canvas/CanvasEvent.cxx +++ b/simgear/canvas/CanvasEvent.cxx @@ -62,6 +62,12 @@ namespace canvas return target; } + //---------------------------------------------------------------------------- + ElementWeakPtr Event::getCurrentTarget() const + { + return current_target; + } + //---------------------------------------------------------------------------- double Event::getTime() const { diff --git a/simgear/canvas/CanvasEvent.hxx b/simgear/canvas/CanvasEvent.hxx index 39c65abc..c3121269 100644 --- a/simgear/canvas/CanvasEvent.hxx +++ b/simgear/canvas/CanvasEvent.hxx @@ -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; diff --git a/simgear/canvas/CanvasEventManager.cxx b/simgear/canvas/CanvasEventManager.cxx index 3e5c4028..50e8c49f 100644 --- a/simgear/canvas/CanvasEventManager.cxx +++ b/simgear/canvas/CanvasEventManager.cxx @@ -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 )