Fixed an issue where ComponentList elements would not get correctly centered vertically.

This commit is contained in:
Leon Styhre 2021-10-29 19:44:27 +02:00
parent 0dc6f1e17a
commit 59839546a5

View file

@ -448,7 +448,7 @@ void ComponentList::updateElementPosition(const ComponentListRow& row)
const auto comp = row.elements.at(i).component; const auto comp = row.elements.at(i).component;
// Center vertically. // Center vertically.
comp->setPosition(x, (rowHeight - comp->getSize().y) / 2.0f + yOffset); comp->setPosition(x, std::round((rowHeight - comp->getSize().y) / 2.0f + yOffset));
x += comp->getSize().x; x += comp->getSize().x;
} }
} }