fix segfault in badge destructor

fix margins
This commit is contained in:
Sophia Hadash 2021-09-26 22:59:14 +02:00
parent a4d4493d3e
commit e2c1d2d0ef
2 changed files with 3 additions and 4 deletions

View file

@ -51,8 +51,7 @@ BadgesComponent::BadgesComponent(Window *window)
} }
BadgesComponent::~BadgesComponent() { BadgesComponent::~BadgesComponent() {
mBadgeIcons.clear(); mChildren.clear();
mImageComponents.clear();
} }

View file

@ -121,12 +121,12 @@ void FlexboxComponent::computeLayout()
float y = anchorY - anchorOriginY * size.y; float y = anchorY - anchorOriginY * size.y;
// Apply item margin. // Apply item margin.
if ((mDirection == "row" && i % std::max(1, (int) mItemsPerLine) != 0) || /*if ((mDirection == "row" && i % std::max(1, (int) mItemsPerLine) != 0) ||
(mDirection == "column" && i >= (int) mItemsPerLine)) (mDirection == "column" && i >= (int) mItemsPerLine))
x += mItemMargin.x * (directionLine.x >= 0.0f ? 1.0f : -1.0f); x += mItemMargin.x * (directionLine.x >= 0.0f ? 1.0f : -1.0f);
if ((mDirection == "column" && i % std::max(1, (int) mItemsPerLine) != 0) || if ((mDirection == "column" && i % std::max(1, (int) mItemsPerLine) != 0) ||
(mDirection == "row" && i >= (int) mItemsPerLine)) (mDirection == "row" && i >= (int) mItemsPerLine))
y += mItemMargin.y * (directionLine.y >= 0.0f ? 1.0f : -1.0f); y += mItemMargin.y * (directionLine.y >= 0.0f ? 1.0f : -1.0f);*/
// Apply alignment // Apply alignment
if (mAlign == ITEM_ALIGN_END) { if (mAlign == ITEM_ALIGN_END) {