MCPcopy Create free account
hub / github.com/SpartanJ/eepp / overFind

Method overFind

src/eepp/scene/node.cpp:995–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

993}
994
995Node* Node::overFind( const Vector2f& point ) {
996 Node* pOver = NULL;
997
998 if ( ( mNodeFlags & NODE_FLAG_OVER_FIND_ALLOWED ) && mEnabled && mVisible ) {
999 updateWorldPolygon();
1000
1001 if ( mWorldBounds.contains( point ) && mPoly.pointInside( point ) ) {
1002 writeNodeFlag( NODE_FLAG_MOUSEOVER_ME_OR_CHILD, 1 );
1003 mSceneNode->addMouseOverNode( this );
1004
1005 Node* child = mChildLast;
1006
1007 while ( NULL != child ) {
1008 Node* childOver = child->overFind( point );
1009
1010 if ( NULL != childOver ) {
1011 pOver = childOver;
1012
1013 break; // Search from top to bottom, so the first over will be the topmost
1014 }
1015
1016 child = child->mPrev;
1017 }
1018
1019 if ( NULL == pOver )
1020 pOver = this;
1021 }
1022 }
1023
1024 return pOver;
1025}
1026
1027void Node::detach() {
1028 if ( mParentNode ) {

Callers 5

onDragMethod · 0.45
onFileDroppedMethod · 0.45
onTextDroppedMethod · 0.45
updateMethod · 0.45
UTESTFunction · 0.45

Calls 3

addMouseOverNodeMethod · 0.80
containsMethod · 0.45
pointInsideMethod · 0.45

Tested by 1

UTESTFunction · 0.36