[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32218] trunk/blender/source/blender/ editors/interface/interface_icons.c: Fix #24067: sculpt brush/ texture preview would disappear when overlapping

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Sep 30 20:35:54 CEST 2010


Revision: 32218
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32218
Author:   blendix
Date:     2010-09-30 20:35:54 +0200 (Thu, 30 Sep 2010)

Log Message:
-----------
Fix #24067: sculpt brush/texture preview would disappear when overlapping
with the region boundary. Use glaDrawPixelsSafe like e.g. the image editor
to prevent this.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_icons.c

Modified: trunk/blender/source/blender/editors/interface/interface_icons.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_icons.c	2010-09-30 17:23:39 UTC (rev 32217)
+++ trunk/blender/source/blender/editors/interface/interface_icons.c	2010-09-30 18:35:54 UTC (rev 32218)
@@ -60,6 +60,7 @@
 #include "IMB_imbuf_types.h"
 
 #include "BIF_gl.h"
+#include "BIF_glutil.h"
 
 #include "ED_datafiles.h"
 #include "ED_render.h"
@@ -843,10 +844,6 @@
 		glPixelTransferf(GL_GREEN_SCALE, rgb[1]);
 		glPixelTransferf(GL_BLUE_SCALE, rgb[2]);
 	}
-
-	/* position */
-	glRasterPos2f(x, y);
-	// XXX ui_rasterpos_safe(x, y, aspect);
 	
 	/* draw */
 	if((w<1 || h<1)) {
@@ -869,13 +866,13 @@
 			
 			/* scale it */
 			IMB_scaleImBuf(ima, w, h);
-			glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect);
+			glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect);
 			
 			IMB_freeImBuf(ima);
 		}
 	}
 	else
-		glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+		glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect);
 
 	/* restore color */
 	if(alpha != 0.0f)





More information about the Bf-blender-cvs mailing list