mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 07:35:38 +00:00
bug fixes, adjust theme badge proportions
Signed-off-by: Sophia Hadash <sophiahadash@gmail.com>
This commit is contained in:
parent
123e50cf17
commit
a93b975ca0
|
@ -44,15 +44,12 @@ void FlexboxComponent::computeLayout()
|
|||
}
|
||||
|
||||
// Compute children maximal dimensions.
|
||||
// direction == row
|
||||
// maxItemSize = { ((mMaxSize.x - mItemMargin.x) / mItemsPerLine) - mItemMargin.x, ((mMaxSize.y
|
||||
// - mItemMargin.y) / mLines) - mItemMargin.y};
|
||||
glm::vec2 grid;
|
||||
if (mDirection == Direction::row)
|
||||
grid = {mItemsPerLine, mLines};
|
||||
else
|
||||
grid = {mLines, mItemsPerLine};
|
||||
glm::vec2 maxItemSize = ((mSize - mItemMargin) / grid) - mItemMargin;
|
||||
glm::vec2 maxItemSize = (mSize + mItemMargin - grid * mItemMargin) / grid;
|
||||
|
||||
// Set final children dimensions.
|
||||
for (auto i : mChildren) {
|
||||
|
@ -61,8 +58,13 @@ void FlexboxComponent::computeLayout()
|
|||
oldSize.x = maxItemSize.x;
|
||||
glm::vec2 sizeMaxX = {maxItemSize.x, oldSize.y * (maxItemSize.x / oldSize.x)};
|
||||
glm::vec2 sizeMaxY = {oldSize.x * (maxItemSize.y / oldSize.y), maxItemSize.y};
|
||||
glm::vec2 newSize =
|
||||
sizeMaxX.x * sizeMaxX.y >= sizeMaxY.x * sizeMaxY.y ? sizeMaxX : sizeMaxY;
|
||||
glm::vec2 newSize;
|
||||
if (sizeMaxX.y > maxItemSize.y)
|
||||
newSize = sizeMaxY;
|
||||
else if (sizeMaxY.x > maxItemSize.x)
|
||||
newSize = sizeMaxX;
|
||||
else
|
||||
newSize = sizeMaxX.x * sizeMaxX.y >= sizeMaxY.x * sizeMaxY.y ? sizeMaxX : sizeMaxY;
|
||||
i->setSize(newSize);
|
||||
}
|
||||
|
||||
|
@ -106,17 +108,17 @@ void FlexboxComponent::computeLayout()
|
|||
// Translate anchor.
|
||||
if ((i + 1) % std::max(1, static_cast<int>(mItemsPerLine)) != 0) {
|
||||
// Translate on same line.
|
||||
anchorX += (size.x + mItemMargin.x) * directionLine.x;
|
||||
anchorY += (size.y + mItemMargin.y) * directionLine.y;
|
||||
anchorX += (size.x + mItemMargin.x) * static_cast<float>(directionLine.x);
|
||||
anchorY += (size.y + mItemMargin.y) * static_cast<float>(directionLine.y);
|
||||
}
|
||||
else {
|
||||
// Translate to first position of next line.
|
||||
if (directionRow.x == 0) {
|
||||
anchorY += lineWidth * directionRow.y;
|
||||
anchorY += lineWidth * static_cast<float>(directionRow.y);
|
||||
anchorX = anchorXStart;
|
||||
}
|
||||
else {
|
||||
anchorX += lineWidth * directionRow.x;
|
||||
anchorX += lineWidth * static_cast<float>(directionRow.x);
|
||||
anchorY = anchorYStart;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,13 +238,13 @@ based on: 'recalbox-multi' by the Recalbox community
|
|||
</text>
|
||||
<badges name="md_badges">
|
||||
<pos>0.8125 0.675</pos>
|
||||
<size>0.1 0.2</size>
|
||||
<size>0.15 0.21</size>
|
||||
<origin>0 0</origin>
|
||||
<direction>row</direction>
|
||||
<align>start</align>
|
||||
<itemsPerLine>3</itemsPerLine>
|
||||
<lines>2</lines>
|
||||
<itemMargin>0.005 0.005</itemMargin>
|
||||
<itemMargin>0.0028125 0.005</itemMargin>
|
||||
<slots>favorite completed kidgame broken altemulator</slots>
|
||||
</badges>
|
||||
<!-- This block prevents additional elements from interfering when mixing layouts. -->
|
||||
|
|
Loading…
Reference in a new issue