[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28542] trunk/blender/source/blender/ editors/space_node/node_draw.c: Fix [#20999] Node Header icons drawn wrong
Matt Ebb
matt at mke3.net
Mon May 3 10:43:00 CEST 2010
Revision: 28542
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28542
Author: broken
Date: 2010-05-03 10:43:00 +0200 (Mon, 03 May 2010)
Log Message:
-----------
Fix [#20999] Node Header icons drawn wrong
Would like to re-do this stuff properly at some stage...
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-05-03 07:42:40 UTC (rev 28541)
+++ trunk/blender/source/blender/editors/space_node/node_draw.c 2010-05-03 08:43:00 UTC (rev 28542)
@@ -683,42 +683,32 @@
icon_id= ICON_MATERIAL;
else
icon_id= ICON_MATERIAL_DATA;
- iconofs-=18.0f;
- glEnable(GL_BLEND);
- UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, icon_id, 1.0f, 0.5f);
- glDisable(GL_BLEND);
+ iconofs-=22.0f;
+ uiDefIconBut(node->block, LABEL, B_REDR, icon_id, iconofs, rct->ymax-NODE_DY,
+ UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
if(node->type == NODE_GROUP) {
- 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, 1.0f, rgb);
- }
- else {
- UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_NODETREE, 1.0f, 0.5f);
- }
- glDisable(GL_BLEND);
+ iconofs-=15.0f;
+ uiDefIconBut(node->block, LABEL, B_REDR, ICON_NODETREE, iconofs, rct->ymax-NODE_DY,
+ UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
if(node->typeinfo->flag & NODE_OPTIONS) {
- iconofs-=18.0f;
- glEnable(GL_BLEND);
- UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY, ICON_BUTS, 1.0f, 0.5f);
- glDisable(GL_BLEND);
+ iconofs-=15.0f;
+ uiDefIconBut(node->block, LABEL, B_REDR, ICON_BUTS, iconofs, rct->ymax-NODE_DY,
+ UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
{ /* always hide/reveal unused sockets */
int shade;
- iconofs-=18.0f;
+ iconofs-=15.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, 1.0f, 0.5f);
- glDisable(GL_BLEND);
+ uiDefIconBut(node->block, LABEL, B_REDR, ICON_PLUS, iconofs, rct->ymax-NODE_DY,
+ UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
/* title */
More information about the Bf-blender-cvs
mailing list