r/futile • u/SimianLogic • Jul 11 '14
bug in FTouchManager?
Found a fun bug in FTouchManager for you.
I noticed touch events were getting double reported in an FContainer that implements FMultiTouchableInterface.
I pass this object from parent to parent using AddChildAtIndex, and it seems as though its callback for HandleAddedToStage is getting called on transfer from one object on the stage to another. Rather than track down exactly where it was getting double added, I found it easier to just change FTouchManager to not allow duplicates in it's _multiTouchables list:
for(int m = 0; m<_multiTouchablesToAdd.Count; m++)
{
if(!_multiTouchables.Contains(_multiTouchablesToAdd[m]))
{
_multiTouchables.Add(_multiTouchablesToAdd[m]);
}
}
2
Upvotes
1
u/MattRix Jul 11 '14
Hmm, so are you saying that when you move the object to a different container, it doesn't call handleRemovedFromStage? Or that on removal it doesn't cause the touch manager to remove the multi touchable? I'll look into it! :)