From 943efbb3ed37afda79a761a643030647e85278c0 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Thu, 4 Jul 2013 00:53:49 +0200 Subject: [PATCH] Canvas Event System: add missing currentTarget field. --- simgear/canvas/CanvasEvent.cxx | 6 ++++++ simgear/canvas/CanvasEvent.hxx | 4 +++- simgear/canvas/CanvasEventManager.cxx | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) 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 ) -- 2.39.5