mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed an issue where ComponentList could generate elements with negative widths
This commit is contained in:
parent
3f8abb0807
commit
eccc5095fb
|
@ -382,6 +382,10 @@ void ComponentList::updateElementSize(const ComponentListRow& row)
|
|||
width -= it->component->getSize().x;
|
||||
}
|
||||
|
||||
// This can happen if the element has zero width, or close to zero width.
|
||||
if (width < 0.0f)
|
||||
width = 0.0f;
|
||||
|
||||
// Redistribute the "unused" width equally among the components if resizeWidth is set to true.
|
||||
width = width / resizeVec.size();
|
||||
for (auto it = resizeVec.cbegin(); it != resizeVec.cend(); ++it)
|
||||
|
|
Loading…
Reference in a new issue