Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_edit.c
| Show First 20 Lines • Show All 1,130 Lines • ▼ Show 20 Lines | static bool cursor_isect_multi_input_socket(const float cursor[2], const bNodeSocket *socket) | ||||
| const rctf multi_socket_rect = { | const rctf multi_socket_rect = { | ||||
| .xmin = socket->locx - NODE_SOCKSIZE * 4.0f, | .xmin = socket->locx - NODE_SOCKSIZE * 4.0f, | ||||
| .xmax = socket->locx + NODE_SOCKSIZE * 2.0f, | .xmax = socket->locx + NODE_SOCKSIZE * 2.0f, | ||||
| /*.xmax = socket->locx + NODE_SOCKSIZE * 5.5f | /*.xmax = socket->locx + NODE_SOCKSIZE * 5.5f | ||||
| * would be the same behavior as for regular sockets. | * would be the same behavior as for regular sockets. | ||||
| * But keep it smaller because for multi-input socket you | * But keep it smaller because for multi-input socket you | ||||
| * sometimes want to drag the link to the other side, if you may | * sometimes want to drag the link to the other side, if you may | ||||
| * accidentally pick the wrong link otherwise. */ | * accidentally pick the wrong link otherwise. */ | ||||
| .ymin = socket->locy - node_socket_height * 0.5 - NODE_SOCKSIZE, | .ymin = socket->locy - node_socket_height, | ||||
| .ymax = socket->locy + node_socket_height * 0.5 + NODE_SOCKSIZE, | .ymax = socket->locy + node_socket_height, | ||||
| }; | }; | ||||
| if (BLI_rctf_isect_pt(&multi_socket_rect, cursor[0], cursor[1])) { | if (BLI_rctf_isect_pt(&multi_socket_rect, cursor[0], cursor[1])) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* type is SOCK_IN and/or SOCK_OUT */ | /* type is SOCK_IN and/or SOCK_OUT */ | ||||
| ▲ Show 20 Lines • Show All 1,690 Lines • Show Last 20 Lines | |||||