Node editor: icons in header sometimes were on wrong locations.
The click hotspots were also off...
This commit is contained in:
Ton Roosendaal 2011-02-18 17:53:11 +00:00
parent 7a29a44cf4
commit 7a8a9b4875
2 changed files with 6 additions and 6 deletions

@ -665,8 +665,8 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiSetRoundBox(3);
uiRoundBox(rct->xmin, rct->ymax-NODE_DY, rct->xmax, rct->ymax, BASIS_RAD);
/* show/hide icons, note this sequence is copied in editnode.c */
iconofs= rct->xmax;
/* show/hide icons, note this sequence is copied in do_header_node() node_state.c */
iconofs= rct->xmax - 7.0f;
if(node->typeinfo->flag & NODE_PREVIEW) {
int icon_id;
@ -675,7 +675,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
icon_id= ICON_MATERIAL;
else
icon_id= ICON_MATERIAL_DATA;
iconofs-=22.0f;
iconofs-=15.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, "");
}

@ -117,21 +117,21 @@ static int do_header_node(SpaceNode *snode, bNode *node, float mx, float my)
node->flag ^= NODE_PREVIEW;
return 1;
}
totr.xmin-=18.0f;
totr.xmin-=15.0f;
}
if(node->type == NODE_GROUP) {
if(BLI_in_rctf(&totr, mx, my)) {
snode_make_group_editable(snode, node);
return 1;
}
totr.xmin-=18.0f;
totr.xmin-=15.0f;
}
if(node->typeinfo->flag & NODE_OPTIONS) {
if(BLI_in_rctf(&totr, mx, my)) {
node->flag ^= NODE_OPTIONS;
return 1;
}
totr.xmin-=18.0f;
totr.xmin-=15.0f;
}
/* hide unused sockets */
if(BLI_in_rctf(&totr, mx, my)) {