Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.c
| Context not available. | |||||
| int node_select_area_default(bNode *node, int x, int y) | int node_select_area_default(bNode *node, int x, int y) | ||||
| { | { | ||||
| return BLI_rctf_isect_pt(&node->totr, x, y); | rctf area; | ||||
| area.xmax = node->totr.xmax + 3.0f; | |||||
| area.xmin = node->totr.xmin - 3.0f; | |||||
| area.ymax = node->totr.ymax + 3.0f; | |||||
| area.ymin = node->totr.ymin - 3.0f; | |||||
| return BLI_rctf_isect_pt(&area, x, y); | |||||
| } | } | ||||
| int node_tweak_area_default(bNode *node, int x, int y) | int node_tweak_area_default(bNode *node, int x, int y) | ||||
| { | { | ||||
| return BLI_rctf_isect_pt(&node->totr, x, y); | rctf area; | ||||
| area.xmax = node->totr.xmax + 3.0f; | |||||
| area.xmin = node->totr.xmin - 3.0f; | |||||
| area.ymax = node->totr.ymax + 3.0f; | |||||
| area.ymin = node->totr.ymin - 3.0f; | |||||
| return BLI_rctf_isect_pt(&area, x, y); | |||||
| } | } | ||||
| int node_get_colorid(bNode *node) | int node_get_colorid(bNode *node) | ||||
| Context not available. | |||||
| else { | else { | ||||
| /* check nodes front to back */ | /* check nodes front to back */ | ||||
| for (node = ntree->nodes.last; node; node = node->prev) { | for (node = ntree->nodes.last; node; node = node->prev) { | ||||
| if (BLI_rctf_isect_pt(&node->totr, cursor[0], cursor[1])) | rctf area; | ||||
| area.xmax = node->totr.xmax + 3.0f; | |||||
| area.xmin = node->totr.xmin - 3.0f; | |||||
| area.ymax = node->totr.ymax + 3.0f; | |||||
| area.ymin = node->totr.ymin - 3.0f; | |||||
| if (BLI_rctf_isect_pt(&area, cursor[0], cursor[1])) | |||||
| break; /* first hit on node stops */ | break; /* first hit on node stops */ | ||||
| } | } | ||||
| if (node) { | if (node) { | ||||
| Context not available. | |||||