diff options
author | Matt Ebb <matt@mke3.net> | 2007-07-03 11:39:17 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2007-07-03 11:39:17 +0400 |
commit | b21e895d032b4d3edb9d0e5a047b69a542971672 (patch) | |
tree | a5358878ed998f58719dce24390df0a8356dba25 /source/blender/src/editnode.c | |
parent | f12ed164b733f542dbe9478d13189e716092473f (diff) |
* Added a bit more 'padding' around the node sockets, so there's a
larger area to drop the noodle connection on. This helps a lot when
working with lots of nodes and the view zoomed out to maximum.
Diffstat (limited to 'source/blender/src/editnode.c')
-rw-r--r-- | source/blender/src/editnode.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index 28c1d898a62..aa8dcc908c5 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -836,15 +836,28 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket ** short mval[2]; getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &rect.xmin, &rect.ymin); - - rect.xmin -= NODE_SOCKSIZE+3; - rect.ymin -= NODE_SOCKSIZE+3; - rect.xmax = rect.xmin + 2*NODE_SOCKSIZE+6; - rect.ymax = rect.ymin + 2*NODE_SOCKSIZE+6; /* check if we click in a socket */ for(node= snode->edittree->nodes.first; node; node= node->next) { + + areamouseco_to_ipoco(G.v2d, mval, &rect.xmin, &rect.ymin); + + rect.xmin -= NODE_SOCKSIZE+3; + rect.ymin -= NODE_SOCKSIZE+3; + rect.xmax = rect.xmin + 2*NODE_SOCKSIZE+6; + rect.ymax = rect.ymin + 2*NODE_SOCKSIZE+6; + + if (!(node->flag & NODE_HIDDEN)) { + /* extra padding inside and out - allow dragging on the text areas too */ + if (in_out == SOCK_IN) { + rect.xmax += NODE_SOCKSIZE; + rect.xmin -= NODE_SOCKSIZE*4; + } else if (in_out == SOCK_OUT) { + rect.xmax += NODE_SOCKSIZE*4; + rect.xmin -= NODE_SOCKSIZE; + } + } + if(in_out & SOCK_IN) { for(sock= node->inputs.first; sock; sock= sock->next) { if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { |