[dispatcher] Supporting changing priority from fixed value to node or from node to fixed value.

This commit is contained in:
James Chen 2013-09-15 12:17:01 +08:00
parent 1b9658f5ad
commit d940e01bc1
1 changed files with 5 additions and 3 deletions

View File

@ -185,7 +185,6 @@ void EventDispatcher::setPriorityWithSceneGraph(EventListener* listener, Node* n
auto item = *itemIter;
if (item->listener == listener)
{
// FIXME: fixed priority --> scene graph's priority.
item->fixedPriority = 0;
item->node = node;
return;
@ -206,9 +205,12 @@ void EventDispatcher::setPriorityWithFixedValue(EventListener* listener, int fix
auto item = *itemIter;
if (item->listener == listener)
{
// FIXME: scene graph's priority --> fixed priority.
item->fixedPriority = fixedPriority;
item->node = nullptr;
if (item->node != nullptr)
{
item->node->dissociateEventListener(listener);
item->node = nullptr;
}
return;
}
}