diff options
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index b72a6503749..8fdee01f78e 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1128,10 +1128,15 @@ static bool cursor_isect_multi_input_socket(const float cursor[2], const bNodeSo { const float node_socket_height = node_socket_calculate_height(socket); const rctf multi_socket_rect = { - .xmin = socket->locx - NODE_SOCKSIZE * 4, - .xmax = socket->locx + NODE_SOCKSIZE, - .ymin = socket->locy - node_socket_height * 0.5 - NODE_SOCKSIZE * 2.0f, - .ymax = socket->locy + node_socket_height * 0.5 + NODE_SOCKSIZE * 2.0f, + .xmin = socket->locx - NODE_SOCKSIZE * 4.0f, + .xmax = socket->locx + NODE_SOCKSIZE * 2.0f, + /*.xmax = socket->locx + NODE_SOCKSIZE * 5.5f + * would be the same behavior as for regular sockets. + * But keep it smaller because for multi-input socket you + * sometimes want to drag the link to the other side, if you may + * accidentally pick the wrong link otherwise. */ + .ymin = socket->locy - node_socket_height * 0.5 - NODE_SOCKSIZE, + .ymax = socket->locy + node_socket_height * 0.5 + NODE_SOCKSIZE, }; if (BLI_rctf_isect_pt(&multi_socket_rect, cursor[0], cursor[1])) { return true; @@ -1141,7 +1146,7 @@ static bool cursor_isect_multi_input_socket(const float cursor[2], const bNodeSo /* type is SOCK_IN and/or SOCK_OUT */ int node_find_indicated_socket( - SpaceNode *snode, bNode **nodep, bNodeSocket **sockp, float cursor[2], int in_out) + SpaceNode *snode, bNode **nodep, bNodeSocket **sockp, const float cursor[2], int in_out) { rctf rect; |