float leftMin = FLT_MAX;
float topMin = FLT_MAX;
uint numChildren = [self numChildren];
if(numChildren == 0)
{
return;
}
for(uint child = 0; child < numChildren; child++)
{
if(child.x < leftMin)
{
leftMin = child.x;
}
if(child.y < topMin)
{
topMin = child.y;
}
}
self.x -= leftMin;
self.y -= topMin;
//Might need to change pivot? Haven't tested, it's pseudo. :D
for(uint child = 0; child < numChildren; child++)
{
child.x += leftMin;
child.y += topMin;
}
_orientationChanged = YES;
Reason: To be able to trim the edges of a container so it is certain width is the actual width and height is the actual height.