[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26657] trunk/blender/source/blender/ editors/space_node/node_draw.c: Patch + Bugfix #20999: Node Header icons drawn wrong

Joshua Leung aligorith at gmail.com
Sun Feb 7 03:54:46 CET 2010


Revision: 26657
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26657
Author:   aligorith
Date:     2010-02-07 03:54:41 +0100 (Sun, 07 Feb 2010)

Log Message:
-----------
Patch + Bugfix #20999: Node Header icons drawn wrong

Thanks to Thomas Raab (fando) for this patch.

This patch fixes the arrow showing whether nodes are expanded or not, and includes a fix for the other icons getting scaled twice.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/node_draw.c

Modified: trunk/blender/source/blender/editors/space_node/node_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_draw.c	2010-02-07 01:11:02 UTC (rev 26656)
+++ trunk/blender/source/blender/editors/space_node/node_draw.c	2010-02-07 02:54:41 UTC (rev 26657)
@@ -92,7 +92,7 @@
 // XXX interface.h
 extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
 extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
-extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
+extern void ui_draw_tria_icon(float x, float y, char dir);
 
 void ED_node_changed_update(ID *id, bNode *node)
 {
@@ -662,41 +662,41 @@
 			icon_id= ICON_MATERIAL;
 		else
 			icon_id= ICON_MATERIAL_DATA;
-		iconofs-= 20.0f;
+		iconofs-=18.0f;
 		glEnable(GL_BLEND);
-		UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, icon_id, snode->aspect, 0.5f);
+		UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, icon_id, 1.0f, 0.5f);
 		glDisable(GL_BLEND);
 	}
 	if(node->type == NODE_GROUP) {
 		
-		iconofs-= 20.0f;
+		iconofs-=18.0f;
 		glEnable(GL_BLEND);
 		if(node->id->lib) {
 			float rgb[3] = {1.0f, 0.7f, 0.3f};
-			UI_icon_draw_aspect_color(iconofs, rct->ymax-NODE_DY, ICON_NODETREE, snode->aspect, rgb);
+			UI_icon_draw_aspect_color(iconofs, rct->ymax-NODE_DY, ICON_NODETREE, 1.0f, rgb);
 		}
 		else {
-			UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_NODETREE, snode->aspect, 0.5f);
+			UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_NODETREE, 1.0f, 0.5f);
 		}
 		glDisable(GL_BLEND);
 	}
 	if(node->typeinfo->flag & NODE_OPTIONS) {
-		iconofs-= 20.0f;
+		iconofs-=18.0f;
 		glEnable(GL_BLEND);
-		UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_BUTS, snode->aspect, 0.5f);
+		UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_BUTS, 1.0f, 0.5f);
 		glDisable(GL_BLEND);
 	}
 	{	/* always hide/reveal unused sockets */ 
 		int shade;
 
-		iconofs-= 20.0f;
+		iconofs-=18.0f;
 		// XXX re-enable
 		/*if(node_has_hidden_sockets(node))
 			shade= -40;
 		else*/
 			shade= -90;
 		glEnable(GL_BLEND);
-		UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_PLUS, snode->aspect, 0.5f);
+		UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_PLUS, 1.0f, 0.5f);
 		glDisable(GL_BLEND);
 	}
 	
@@ -707,7 +707,7 @@
 		UI_ThemeColorBlendShade(TH_TEXT, color_id, 0.4f, 10);
 	
 	/* open/close entirely? */
-	ui_draw_tria_icon(rct->xmin+8.0f, rct->ymax-NODE_DY+4.0f, snode->aspect, 'v');
+	ui_draw_tria_icon(rct->xmin+8.0f, rct->ymax-NODE_DY+4.0f, 'v');
 	
 	if(node->flag & SELECT) 
 		UI_ThemeColor(TH_TEXT_HI);
@@ -862,7 +862,7 @@
 		UI_ThemeColorBlendShade(TH_TEXT, color_id, 0.4f, 10);
 	
 	/* open entirely icon */
-	ui_draw_tria_icon(rct->xmin+9.0f, centy-6.0f, snode->aspect, 'h');	
+	ui_draw_tria_icon(rct->xmin+9.0f, centy-6.0f, 'h');	
 	
 	/* disable lines */
 	if(node->flag & NODE_MUTED)





More information about the Bf-blender-cvs mailing list