diff --git a/es-core/src/GuiComponent.cpp b/es-core/src/GuiComponent.cpp index d16652ad5..bb2333c0c 100644 --- a/es-core/src/GuiComponent.cpp +++ b/es-core/src/GuiComponent.cpp @@ -206,7 +206,7 @@ void GuiComponent::setDimming(float dimming) const glm::mat4& GuiComponent::getTransform() { mTransform = Renderer::getIdentity(); - mTransform = glm::translate(mTransform, mPosition); + mTransform = glm::translate(mTransform, glm::round(mPosition)); if (mScale != 1.0f) mTransform = glm::scale(mTransform, glm::vec3 {mScale}); @@ -228,8 +228,10 @@ const glm::mat4& GuiComponent::getTransform() if (xOff != 0.0f || yOff != 0.0f) mTransform = glm::translate(mTransform, glm::vec3 {xOff, yOff, 0.0f}); } - mTransform = glm::translate( - mTransform, glm::vec3 {mOrigin.x * mSize.x * -1.0f, mOrigin.y * mSize.y * -1.0f, 0.0f}); + + mTransform = + glm::translate(mTransform, glm::vec3 {std::round(mOrigin.x * mSize.x * -1.0f), + std::round(mOrigin.y * mSize.y * -1.0f), 0.0f}); return mTransform; } diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index c428fbf96..21ff64219 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -204,7 +204,7 @@ 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, yOff, 0.0f}); + trans = glm::translate(trans, glm::vec3 {0.0f, std::round(yOff), 0.0f}); mRenderer->setMatrix(trans); // Draw the text area, where the text actually is located. diff --git a/es-core/src/renderers/RendererOpenGL.cpp b/es-core/src/renderers/RendererOpenGL.cpp index dae114a58..7f4741a48 100644 --- a/es-core/src/renderers/RendererOpenGL.cpp +++ b/es-core/src/renderers/RendererOpenGL.cpp @@ -278,7 +278,6 @@ void RendererOpenGL::destroyContext() void RendererOpenGL::setMatrix(const glm::mat4& matrix) { mTrans = matrix; - mTrans[3] = glm::round(mTrans[3]); mTrans = getProjectionMatrix() * mTrans; }