From ebcc0f95b051b4cc32b9201eaca04fd140986709 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 10 Feb 2023 00:55:58 +0100 Subject: [PATCH] Fixed an issue in GridComponent where the item size was sometimes not calculated correctly when running on a vertically oriented screen. --- es-core/src/components/primary/GridComponent.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/primary/GridComponent.h b/es-core/src/components/primary/GridComponent.h index 2da859804..5589d5ff8 100644 --- a/es-core/src/components/primary/GridComponent.h +++ b/es-core/src/components/primary/GridComponent.h @@ -896,7 +896,10 @@ void GridComponent::applyTheme(const std::shared_ptr& theme, const glm::vec2& itemSize {elem->get("itemSize")}; if (!(itemSize.x == -1 && itemSize.y == -1)) { if (itemSize.x == -1) { - mItemSize.y = glm::clamp(itemSize.y, 0.05f, 1.0f) * mRenderer->getScreenHeight(); + mItemSize.y = + glm::clamp(itemSize.y, 0.05f, 1.0f) * (mRenderer->getIsVerticalOrientation() ? + mRenderer->getScreenWidth() : + mRenderer->getScreenHeight()); mItemSize.x = mItemSize.y; } else if (itemSize.y == -1) {