[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43367] trunk/blender/source/blender/ editors/interface: fix for own error making button outlines darker.

Campbell Barton ideasman42 at gmail.com
Sat Jan 14 08:46:39 CET 2012


Revision: 43367
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43367
Author:   campbellbarton
Date:     2012-01-14 07:46:21 +0000 (Sat, 14 Jan 2012)
Log Message:
-----------
fix for own error making button outlines darker.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_intern.h
    trunk/blender/source/blender/editors/interface/interface_widgets.c

Modified: trunk/blender/source/blender/editors/interface/interface_intern.h
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_intern.h	2012-01-14 07:23:57 UTC (rev 43366)
+++ trunk/blender/source/blender/editors/interface/interface_intern.h	2012-01-14 07:46:21 UTC (rev 43367)
@@ -444,7 +444,7 @@
 /* interface_draw.c */
 extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
 
-void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha);
+void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha);
 
 void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect);
 void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect);

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-01-14 07:23:57 UTC (rev 43366)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-01-14 07:46:21 UTC (rev 43367)
@@ -752,10 +752,10 @@
 		float quad_strip[WIDGET_SIZE_MAX*2+2][2]; /* + 2 because the last pair is wrapped */
 		float quad_strip_emboss[WIDGET_SIZE_MAX*2][2]; /* only for emboss */
 
-		const GLubyte tcol[4] = {wcol->outline[0],
-		                         wcol->outline[1],
-		                         wcol->outline[2],
-		                         wcol->outline[3] / (WIDGET_AA_JITTER / 2)};
+		const unsigned char tcol[4] = {wcol->outline[0],
+		                               wcol->outline[1],
+		                               wcol->outline[2],
+		                               UCHAR_MAX / WIDGET_AA_JITTER};
 
 		widget_verts_to_quad_strip(wtb, wtb->totvert, quad_strip);
 
@@ -790,10 +790,10 @@
 	
 	/* decoration */
 	if(wtb->tria1.tot || wtb->tria2.tot) {
-		const GLubyte tcol[4] = {wcol->item[0],
-		                         wcol->item[1],
-		                         wcol->item[2],
-		                         wcol->item[3] / (WIDGET_AA_JITTER / 2)};
+		const unsigned char tcol[4] = {wcol->item[0],
+		                               wcol->item[1],
+		                               wcol->item[2],
+		                               (unsigned char)((float)wcol->item[3] / WIDGET_AA_JITTER)};
 		/* for each AA step */
 		for (j = 0; j < WIDGET_AA_JITTER; j++) {
 			glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
@@ -1887,7 +1887,7 @@
 /* ************ custom buttons, old stuff ************** */
 
 /* draws in resolution of 20x4 colors */
-void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha)
+void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha)
 {
 	int a;
 	float h= hsv[0], s= hsv[1], v= hsv[2];



More information about the Bf-blender-cvs mailing list