From dbe0cc7c8442adacb7799294ce6e4409d59657e5 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Wed, 31 Aug 2005 08:32:16 +0000 Subject: Fix push/pop clip area, also fixes the broken scrollareas. --- ChangeLog | 6 ++++++ src/openglgraphics.cpp | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4a28d23..21343def 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-31 Björn Steinbrink + + * src/openglgraphics.cpp: Fix push/pop of clip area, we need to + translate using the x/y offset, not the x/y coordinates of the clip + area. This fixes the broken scrollareas. + 2005-08-30 Eugenio Favalli * The Mana World.dev: Updated project file. diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index cc85c0ef..00449d3f 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -140,14 +140,14 @@ bool OpenGLGraphics::pushClipArea(gcn::Rectangle area) int transY = 0; if (!mClipStack.empty()) { - transX = -mClipStack.top().x; - transY = -mClipStack.top().y; + transX = -mClipStack.top().xOffset; + transY = -mClipStack.top().yOffset; } bool result = gcn::Graphics::pushClipArea(area); - transX += mClipStack.top().x; - transY += mClipStack.top().y; + transX += mClipStack.top().xOffset; + transY += mClipStack.top().yOffset; glTranslatef(transX, transY, 0); glScissor(mClipStack.top().x, @@ -160,8 +160,8 @@ bool OpenGLGraphics::pushClipArea(gcn::Rectangle area) void OpenGLGraphics::popClipArea() { - int transX = -mClipStack.top().x; - int transY = -mClipStack.top().y; + int transX = -mClipStack.top().xOffset; + int transY = -mClipStack.top().yOffset; gcn::Graphics::popClipArea(); @@ -170,8 +170,8 @@ void OpenGLGraphics::popClipArea() return; } - transX += mClipStack.top().x; - transY += mClipStack.top().y; + transX += mClipStack.top().xOffset; + transY += mClipStack.top().yOffset; glTranslatef(transX, transY, 0); glScissor(mClipStack.top().x, -- cgit v1.2.3-60-g2f50