mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Fixed an issue in GridComponent where the item size was sometimes not calculated correctly when running on a vertically oriented screen.
This commit is contained in:
parent
79b5993732
commit
ebcc0f95b0
|
@ -896,7 +896,10 @@ void GridComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
const glm::vec2& itemSize {elem->get<glm::vec2>("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) {
|
||||
|
|
Loading…
Reference in a new issue