MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getAncestor

Method getAncestor

forms/control.cpp:908–923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908sp<Control> Control::getAncestor(sp<Control> Parent)
909{
910 sp<Control> ancestor = shared_from_this();
911 while (ancestor != nullptr)
912 {
913 if (ancestor->getParent() == Parent)
914 {
915 break;
916 }
917 else
918 {
919 ancestor = ancestor->getParent();
920 }
921 }
922 return ancestor;
923}
924
925void Control::setRelativeWidth(float widthFactor)
926{

Callers 2

eventOccuredMethod · 0.80
eventOccuredMethod · 0.80

Calls 1

getParentMethod · 0.80

Tested by

no test coverage detected