From 6e2867b935af242ca96767732e37b85a01620f42 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Jun 2014 13:25:15 +0300 Subject: Use cliparea for texture drawing position in modernopengl. --- src/render/modernopenglgraphics.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/render/modernopenglgraphics.cpp') diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index fd700a9cf..ab8a9a787 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -297,9 +297,12 @@ bool ModernOpenGLGraphics::drawImageInline(const Image *const image, bindTexture(GL_TEXTURE_2D, image->mGLImage); setTexturingAndBlending(true); + const ClipRect &clipArea = mClipStack.top(); const SDL_Rect &imageRect = image->mBounds; - drawQuad(image, imageRect.x, imageRect.y, - dstX, dstY, imageRect.w, imageRect.h); + drawQuad(image, + imageRect.x, imageRect.y, + dstX + clipArea.xOffset, dstY + clipArea.yOffset, + imageRect.w, imageRect.h); return true; } -- cgit v1.2.3-60-g2f50