Fix an issue with groups, and add Chapter 14 example!

This commit is contained in:
Godzil
2020-02-26 00:30:09 +00:00
parent aded6bb943
commit 5e4cfb84e6
7 changed files with 244 additions and 3 deletions

View File

@@ -136,4 +136,32 @@ void Group::updateBoundingBox()
}
}
}
}
void Group::updateTransform()
{
int i;
Shape::updateTransform();
if (this->objectCount > 0)
{
for (i = 0 ; i < this->objectCount ; i++)
{
this->objectList[i]->updateTransform();
}
}
/* We are force to do them all the time */
if (this->unboxableObjectCount > 0)
{
for(i = 0; i < this->unboxableObjectCount; i++)
{
this->unboxableObjectList[i]->updateTransform();
}
}
/* Once the full stack being notified of the changes, let's update the
* bounding box
*/
this->updateBoundingBox();
}