{
// If there is a widget present, include its bounds
UIWidget w = content.GetComponent<UIWidget>();
if (w != null && w.enabled)
{
Vector3[] corners = w.worldCorners;
for (int j = 0; j < 4; ++j)
{
Vector3 v = toLocal.MultiplyPoint3x4(corners[j]);
if (v.x > vMax.x) vMax.x = v.x;
if (v.y > vMax.y) vMax.y = v.y;
if (v.z > vMax.z) vMax.z = v.z;
if (v.x < vMin.x) vMin.x = v.x;
if (v.y < vMin.y) vMin.y = v.y;
if (v.z < vMin.z) vMin.z = v.z;
isSet = true;
}
}
// Iterate through children including their bounds in turn
for (int i = 0, imax = content.childCount; i < imax; ++i)
CalculateRelativeWidgetBounds(content.GetChild(i), considerInactive, false, ref toLocal, ref vMin, ref vMax, ref isSet);
}