Canvas Event System: add missing currentTarget field.

This commit is contained in:
Thomas Geymayer
2013-07-04 00:53:49 +02:00
parent 6962de4b1f
commit 943efbb3ed
3 changed files with 10 additions and 1 deletions

View File

@@ -62,6 +62,12 @@ namespace canvas
return target;
}
//----------------------------------------------------------------------------
ElementWeakPtr Event::getCurrentTarget() const
{
return current_target;
}
//----------------------------------------------------------------------------
double Event::getTime() const
{

View 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;

View 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 )