From ecaf21b22616cad649784e6874249e35f1feee7b Mon Sep 17 00:00:00 2001
From: richard <none@none>
Date: Wed, 4 Nov 2009 20:46:17 -0800
Subject: [PATCH] better fix for clipping not working

---
 indra/llui/lllocalcliprect.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lllocalcliprect.cpp b/indra/llui/lllocalcliprect.cpp
index f5a78e10994..43c21e250ce 100644
--- a/indra/llui/lllocalcliprect.cpp
+++ b/indra/llui/lllocalcliprect.cpp
@@ -77,8 +77,6 @@ LLScreenClipRect::LLScreenClipRect(const LLRect& rect, BOOL enabled)
 
 LLScreenClipRect::~LLScreenClipRect()
 {
-	// finish any deferred calls in this clipping region
-	gGL.flush();
 	if (mEnabled)
 	{
 		popClipRect();
@@ -115,6 +113,9 @@ void LLScreenClipRect::updateScissorRegion()
 {
 	if (sClipRectStack.empty()) return;
 
+	// finish any deferred calls in the old clipping region
+	gGL.flush();
+
 	LLRect rect = sClipRectStack.top();
 	stop_glerror();
 	S32 x,y,w,h;
-- 
GitLab