mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Fixed an image positioning issue in GridComponent when using the scaleInwards property
This commit is contained in:
parent
be3cde3d7f
commit
ac272bc944
|
@ -815,14 +815,18 @@ template <typename T> void GridComponent<T>::render(const glm::mat4& parentTrans
|
||||||
offsetInwards.x = -(mItemSize.x / 2.0f);
|
offsetInwards.x = -(mItemSize.x / 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool textEntry {mEntries.at(*it).data.imagePath.empty() &&
|
||||||
|
mEntries.at(*it).data.defaultImagePath.empty()};
|
||||||
const glm::vec2 position {
|
const glm::vec2 position {
|
||||||
calculateOffsetPos(itemPos, originInwards, scale,
|
calculateOffsetPos(itemPos, originInwards, scale,
|
||||||
(mEntries.at(*it).data.imagePath.empty() &&
|
(textEntry ? mTextRelativeScale : mImageRelativeScale))};
|
||||||
mEntries.at(*it).data.defaultImagePath.empty() ?
|
const glm::vec2 offset {textEntry ? glm::vec2 {0.0f, 0.0f} :
|
||||||
mTextRelativeScale :
|
mItemSize * mImageRelativeScale * scale};
|
||||||
mImageRelativeScale))};
|
if (textEntry)
|
||||||
mEntries.at(*it).data.item->setOrigin(0.0f, 0.0f);
|
mEntries.at(*it).data.item->setOrigin(0.0f, 0.0f);
|
||||||
mEntries.at(*it).data.item->setPosition(position.x, position.y);
|
mEntries.at(*it).data.item->setPosition(position.x, position.y);
|
||||||
|
mEntries.at(*it).data.item->setPosition(position.x + (offset.x / 2.0f),
|
||||||
|
position.y + (offset.y / 2.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cursorEntry && mSelectorLayer == SelectorLayer::BOTTOM)
|
if (cursorEntry && mSelectorLayer == SelectorLayer::BOTTOM)
|
||||||
|
|
Loading…
Reference in a new issue