overhauled physics engine

This commit is contained in:
Dynamitos committed 2023-01-21 18:43:21 +01:00
1 parent 3c7346cf7b
commit 2208ab438a
164 files changed
+22606 -928

No files matched your search

+2 -2
View File
@@ -18,14 +18,14 @@ HorizontalLayout::~HorizontalLayout()
void HorizontalLayout::apply()
{
Array<PElement> children = element->getChildren();
const Math::Rect parent = element->getBoundingBox();
const Rect parent = element->getBoundingBox();
float xOffset = parent.offset.x;
float yOffset = parent.offset.y;
float xSize = parent.size.x / children.size();
float ySize = parent.size.y;
for(uint32 index = 0; index < children.size(); ++index)
{
Math::Rect& child = children[index]->getBoundingBox();
Rect& child = children[index]->getBoundingBox();
child.offset.x = xOffset + (index * xSize);
child.offset.y = yOffset;
child.size.x = xSize;