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.
This commit is contained in:
@@ -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 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
||||
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 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
||||
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 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user