Index: Source/System/Window/OSGGradientBackground.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Window/OSGGradientBackground.cpp,v
retrieving revision 1.9
diff -u -r1.9 OSGGradientBackground.cpp
--- Source/System/Window/OSGGradientBackground.cpp	11 Apr 2007 15:08:18 -0000	1.9
+++ Source/System/Window/OSGGradientBackground.cpp	27 Apr 2007 09:30:06 -0000
@@ -56,6 +56,7 @@
 #include "OSGWindow.h"
 #include "OSGBackground.h"
 #include "OSGGradientBackground.h"
+#include "OSGTileCameraDecorator.h"
 
 OSG_USING_NAMESPACE
 
@@ -119,7 +120,7 @@
 
 /*-------------------------- your_category---------------------------------*/
 
-void GradientBackground::clear(DrawActionBase *, Viewport *)
+void GradientBackground::clear(DrawActionBase *act, Viewport *port)
 {
     Int32 bit = getClearStencilBit();
     
@@ -159,10 +160,45 @@
         glPushMatrix();
         glLoadIdentity();
 
-        glMatrixMode(GL_PROJECTION);
-        glPushMatrix();
-        glLoadIdentity();
-        glOrtho(0, 1, 0, 1, 0, 1);
+
+		glMatrixMode(GL_PROJECTION);
+		glPushMatrix();
+		glLoadIdentity();
+		
+		UInt32 width  = port->getPixelWidth(),
+			   height = port->getPixelHeight();
+	    
+		Camera *cP = act->getCamera();
+		TileCameraDecorator *cdP = dynamic_cast<TileCameraDecorator*>(cP);
+		
+		while (cdP != NULL)
+		{
+			width  = cdP->getFullWidth()  ? cdP->getFullWidth()  : width;
+			height = cdP->getFullHeight() ? cdP->getFullHeight() : height;
+			
+			cP  = cdP->getDecoratee().getCPtr();
+			cdP = dynamic_cast<TileCameraDecorator*>(cP);
+		}
+		
+		cP = act->getCamera();
+		cdP = dynamic_cast<TileCameraDecorator*>(cP);
+	    
+		if (cdP)
+		{
+			Real32 left   = cdP->getLeft(),
+				   right  = cdP->getRight(),
+				   top    = cdP->getTop(),
+				   bottom = cdP->getBottom();
+	        
+			glOrtho( left , 
+					 right,
+					 bottom, 
+					 top, 0, 1);
+		}
+		else
+		{
+			glOrtho(0, 1, 0, 1, 0, 1);    
+		}
 
         Real32 r1, g1, b1;
         UInt32 size = _mfPosition.size();
