diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index 3414ade19..f587b8e97 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -430,7 +430,7 @@ void ImageComponent::render(const glm::mat4& parentTrans) return; glm::mat4 trans {parentTrans * getTransform()}; - mRenderer->setMatrix(trans, false); + mRenderer->setMatrix(trans); if (mTexture && mOpacity > 0.0f) { if (Settings::getInstance()->getBool("DebugImage")) { diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index f3ea7c139..c428fbf96 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -204,13 +204,8 @@ void TextComponent::render(const glm::mat4& parentTrans) mRenderer->drawRect(0.0f, 0.0f, mSize.x, mSize.y, 0x0000FF33, 0x0000FF33); } - trans = glm::translate(trans, glm::vec3 {0.0f, std::round(yOff), 0.0f}); - - // Don't round vertices if scaled as it may lead to single-pixel alignment issues. - if (mScale == 1.0f) - mRenderer->setMatrix(trans, true); - else - mRenderer->setMatrix(trans, false); + trans = glm::translate(trans, glm::vec3 {0.0f, yOff, 0.0f}); + mRenderer->setMatrix(trans); // Draw the text area, where the text actually is located. if (Settings::getInstance()->getBool("DebugText")) { diff --git a/es-core/src/components/primary/CarouselComponent.h b/es-core/src/components/primary/CarouselComponent.h index b43e95d7f..46e4e1362 100644 --- a/es-core/src/components/primary/CarouselComponent.h +++ b/es-core/src/components/primary/CarouselComponent.h @@ -615,9 +615,6 @@ template void CarouselComponent::render(const glm::mat4& parentT yOff += mSize.y * mVerticalOffset; } - xOff = std::round(xOff); - yOff = std::round(yOff); - int center {static_cast(mEntryCamOffset)}; int itemInclusion {static_cast(std::ceil(mMaxItemCount / 2.0f))}; bool singleEntry {numEntries == 1}; diff --git a/es-core/src/renderers/Renderer.h b/es-core/src/renderers/Renderer.h index 289216083..082e42664 100644 --- a/es-core/src/renderers/Renderer.h +++ b/es-core/src/renderers/Renderer.h @@ -202,7 +202,7 @@ public: const unsigned int numVertices, const BlendFactor srcBlendFactor = BlendFactor::SRC_ALPHA, const BlendFactor dstBlendFactor = BlendFactor::ONE_MINUS_SRC_ALPHA) = 0; - virtual void setMatrix(const glm::mat4& matrix, bool roundVertices = true) = 0; + virtual void setMatrix(const glm::mat4& matrix) = 0; virtual void setScissor(const Rect& scissor) = 0; virtual void setSwapInterval() = 0; virtual void swapBuffers() = 0; diff --git a/es-core/src/renderers/RendererOpenGL.cpp b/es-core/src/renderers/RendererOpenGL.cpp index afc984bea..fd19f694a 100644 --- a/es-core/src/renderers/RendererOpenGL.cpp +++ b/es-core/src/renderers/RendererOpenGL.cpp @@ -275,12 +275,10 @@ void RendererOpenGL::destroyContext() mSDLContext = nullptr; } -void RendererOpenGL::setMatrix(const glm::mat4& matrix, bool roundVertices) +void RendererOpenGL::setMatrix(const glm::mat4& matrix) { - mTrans = matrix; - if (roundVertices) - mTrans[3] = glm::round(mTrans[3]); - mTrans = getProjectionMatrix() * mTrans; + // Calculate the project matrix. + mTrans = getProjectionMatrix() * matrix; } void RendererOpenGL::setScissor(const Rect& scissor) diff --git a/es-core/src/renderers/RendererOpenGL.h b/es-core/src/renderers/RendererOpenGL.h index 5384e19dd..ec3a4d7ed 100644 --- a/es-core/src/renderers/RendererOpenGL.h +++ b/es-core/src/renderers/RendererOpenGL.h @@ -38,7 +38,7 @@ public: bool createContext() override; void destroyContext() override; - void setMatrix(const glm::mat4& matrix, bool roundVertices = true) override; + void setMatrix(const glm::mat4& matrix) override; void setScissor(const Rect& scissor) override; void setSwapInterval() override; void swapBuffers() override;