[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31867] trunk/blender/source/blender/ editors/interface/interface_widgets.c: Fix for own stupid bug the other day , messed up the gradients in selected/deselected UI elements.

Matt Ebb matt at mke3.net
Sat Sep 11 02:08:07 CEST 2010


Revision: 31867
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31867
Author:   broken
Date:     2010-09-11 02:08:07 +0200 (Sat, 11 Sep 2010)

Log Message:
-----------
Fix for own stupid bug the other day, messed up the gradients in selected/deselected UI elements.

Didn't know beta was going to be today, really hope this makes it in! 

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

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2010-09-10 23:39:43 UTC (rev 31866)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2010-09-11 00:08:07 UTC (rev 31867)
@@ -1419,6 +1419,9 @@
 			widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend);
 
 		VECCOPY(wt->wcol.text, wt->wcol.text_sel);
+		
+		if(state & UI_SELECT)
+			SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
 	}
 	else {
 		if(state & UI_BUT_ANIMATED_KEY)
@@ -1455,6 +1458,9 @@
 			widget_state_blend(wt->wcol.item, wcol_state->inner_anim_sel, blend);
 		else if(state & UI_BUT_DRIVEN)
 			widget_state_blend(wt->wcol.item, wcol_state->inner_driven_sel, blend);
+		
+		if(state & UI_SELECT)
+			SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
 	}
 	else {
 		if(state & UI_BUT_ANIMATED_KEY)
@@ -1951,6 +1957,9 @@
 	float rad= 0.5f*(rect->ymax - rect->ymin);
 	float textofs = rad*0.75;
 
+	if(state & UI_SELECT)
+		SWAP(short, wcol->shadetop, wcol->shadedown);
+	
 	widget_init(&wtb);
 	
 	/* fully rounded */
@@ -2250,8 +2259,10 @@
 	
 	widgetbase_draw(&wtb1, wcol);
 	VECCOPY(wcol->outline, outline);
-	SWAP(short, wcol->shadetop, wcol->shadedown);
 	
+	if(!(state & UI_SELECT))
+		SWAP(short, wcol->shadetop, wcol->shadedown);
+	
 	/* outline */
 	wtb.outline= 1;
 	wtb.inner= 0;
@@ -2305,6 +2316,9 @@
 {
 	uiWidgetBase wtb;
 	
+	if(state & UI_SELECT)
+		SWAP(short, wcol->shadetop, wcol->shadedown);
+	
 	widget_init(&wtb);
 	
 	/* half rounded */





More information about the Bf-blender-cvs mailing list