MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / findHitControl

Method findHitControl

engine/source/gui/guiControl.cc:1037–1058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035
1036
1037GuiControl* GuiControl::findHitControl(const Point2I &pt, S32 initialLayer)
1038{
1039 iterator i = end(); // find in z order (last to first)
1040 while (i != begin())
1041 {
1042 i--;
1043 GuiControl *ctrl = static_cast<GuiControl *>(*i);
1044 if (initialLayer >= 0 && ctrl->mLayer > initialLayer)
1045 {
1046 continue;
1047 }
1048 else if (ctrl->mVisible && ctrl->pointInControl(pt))
1049 {
1050 Point2I ptemp = pt - ctrl->mBounds.point;
1051 GuiControl *hitCtrl = ctrl->findHitControl(ptemp);
1052
1053 if(hitCtrl->mProfile->mModal)
1054 return hitCtrl;
1055 }
1056 }
1057 return this;
1058}
1059
1060// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
1061

Callers 4

rootMouseDownMethod · 0.45
rootScreenTouchDownMethod · 0.45
rootScreenTouchUpMethod · 0.45

Calls 1

pointInControlMethod · 0.45

Tested by

no test coverage detected