From 1ff82d535e873036f1cadfc103d187db68400220 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 13 Feb 2023 20:21:02 +0100 Subject: [PATCH] Tiny optimization in GridComponent. --- es-core/src/components/primary/GridComponent.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/primary/GridComponent.h b/es-core/src/components/primary/GridComponent.h index 5589d5ff8..c07307732 100644 --- a/es-core/src/components/primary/GridComponent.h +++ b/es-core/src/components/primary/GridComponent.h @@ -786,10 +786,12 @@ template void GridComponent::render(const glm::mat4& parentTrans if (mHasTextSelectedColor && mEntries.at(*it).data.imagePath == "" && mEntries.at(*it).data.defaultImagePath == "") { mEntries.at(*it).data.item->setColor(mTextSelectedColor); - mEntries.at(*it).data.item->setBackgroundColor(mTextSelectedBackgroundColor); + if (mTextSelectedBackgroundColor != mTextBackgroundColor) + mEntries.at(*it).data.item->setBackgroundColor(mTextSelectedBackgroundColor); mEntries.at(*it).data.item->render(trans); mEntries.at(*it).data.item->setColor(mTextColor); - mEntries.at(*it).data.item->setBackgroundColor(mTextBackgroundColor); + if (mTextSelectedBackgroundColor != mTextBackgroundColor) + mEntries.at(*it).data.item->setBackgroundColor(mTextBackgroundColor); } else if (mHasImageSelectedColor) { mEntries.at(*it).data.item->setColorShift(mImageSelectedColor);