From 0560b49686fe91a51277cb96fd46b22beb274129 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Thu, 25 Oct 2018 00:35:51 +0700 Subject: [PATCH] TexrectDrawer::draw() : correct texture coordinates. --- src/TexrectDrawer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TexrectDrawer.cpp b/src/TexrectDrawer.cpp index eefd62d3..eda6fde8 100644 --- a/src/TexrectDrawer.cpp +++ b/src/TexrectDrawer.cpp @@ -380,10 +380,10 @@ bool TexrectDrawer::draw() scaleX *= 2.0f; scaleY *= 2.0f; - const float s0 = (m_ulx + 1.0f) / scaleX / (float)m_pTexture->realWidth; - const float t1 = (m_uly + 1.0f) / scaleY / (float)m_pTexture->realHeight; + const float s0 = (m_ulx + 1.0f) / scaleX / (float)m_pTexture->realWidth + 0.5f / (float)m_pTexture->realWidth; + const float t0 = (m_lry + 1.0f) / scaleY / (float)m_pTexture->realHeight;// +0.5f / (float)m_pTexture->realHeight; const float s1 = (m_lrx + 1.0f) / scaleX / (float)m_pTexture->realWidth; - const float t0 = (m_lry + 1.0f) / scaleY / (float)m_pTexture->realHeight; + const float t1 = (m_uly + 1.0f) / scaleY / (float)m_pTexture->realHeight; const float W = 1.0f; drawer._updateScreenCoordsViewport(m_pBuffer);