mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Fixed an issue where the scroll indicators sometimes overlapped the menu titles.
This commit is contained in:
parent
9037f95fd3
commit
824089d703
|
@ -124,6 +124,15 @@ void MenuComponent::onSizeChanged()
|
||||||
mGrid.setColWidthPerc(1, 0.055f);
|
mGrid.setColWidthPerc(1, 0.055f);
|
||||||
|
|
||||||
mGrid.setSize(mSize);
|
mGrid.setSize(mSize);
|
||||||
|
|
||||||
|
// Limit the title size to reserve space for the scroll indicators.
|
||||||
|
float indicatorsSize {mSize.x * 0.09f};
|
||||||
|
|
||||||
|
glm::vec2 titleSize {mTitle->getSize()};
|
||||||
|
mTitle->setSize(titleSize.x - indicatorsSize, titleSize.y);
|
||||||
|
|
||||||
|
glm::vec3 titlePos {mTitle->getPosition()};
|
||||||
|
mTitle->setPosition(titlePos.x + std::round(indicatorsSize / 2.0f), titlePos.y, titlePos.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuComponent::addButton(const std::string& name,
|
void MenuComponent::addButton(const std::string& name,
|
||||||
|
|
Loading…
Reference in a new issue