From 26b7945171ed015f5aa3ec70ce54a40f60625110 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 24 Nov 2024 13:41:58 +0100 Subject: [PATCH] Fixed an issue where the grid component selector position was not always calculated correctly --- es-core/src/components/primary/GridComponent.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/primary/GridComponent.h b/es-core/src/components/primary/GridComponent.h index 87b8bb428..16a83b6a3 100644 --- a/es-core/src/components/primary/GridComponent.h +++ b/es-core/src/components/primary/GridComponent.h @@ -773,9 +773,11 @@ template void GridComponent::render(const glm::mat4& parentTrans // If a selector color is set but no selector image, then render a rectangle. const float sizeX {mItemSize.x * scale * mSelectorRelativeScale}; const float sizeY {mItemSize.y * scale * mSelectorRelativeScale}; - mRenderer->setMatrix(trans); - mRenderer->drawRect(position.x, position.y, sizeX, sizeY, mSelectorColor, - mSelectorColorEnd, mSelectorColorGradientHorizontal, opacity); + const glm::mat4 drawTrans { + glm::translate(trans, glm::round(glm::vec3 {position.x, position.y, 0.0f}))}; + mRenderer->setMatrix(drawTrans); + mRenderer->drawRect(0.0f, 0.0f, sizeX, sizeY, mSelectorColor, mSelectorColorEnd, + mSelectorColorGradientHorizontal, opacity); } };