Tiny optimization in GridComponent.

This commit is contained in:
Leon Styhre 2023-02-13 20:21:02 +01:00
parent 7cad629240
commit 1ff82d535e

View file

@ -786,9 +786,11 @@ template <typename T> void GridComponent<T>::render(const glm::mat4& parentTrans
if (mHasTextSelectedColor && mEntries.at(*it).data.imagePath == "" && if (mHasTextSelectedColor && mEntries.at(*it).data.imagePath == "" &&
mEntries.at(*it).data.defaultImagePath == "") { mEntries.at(*it).data.defaultImagePath == "") {
mEntries.at(*it).data.item->setColor(mTextSelectedColor); mEntries.at(*it).data.item->setColor(mTextSelectedColor);
if (mTextSelectedBackgroundColor != mTextBackgroundColor)
mEntries.at(*it).data.item->setBackgroundColor(mTextSelectedBackgroundColor); mEntries.at(*it).data.item->setBackgroundColor(mTextSelectedBackgroundColor);
mEntries.at(*it).data.item->render(trans); mEntries.at(*it).data.item->render(trans);
mEntries.at(*it).data.item->setColor(mTextColor); mEntries.at(*it).data.item->setColor(mTextColor);
if (mTextSelectedBackgroundColor != mTextBackgroundColor)
mEntries.at(*it).data.item->setBackgroundColor(mTextBackgroundColor); mEntries.at(*it).data.item->setBackgroundColor(mTextBackgroundColor);
} }
else if (mHasImageSelectedColor) { else if (mHasImageSelectedColor) {