Node Border Select: only frames inside border
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Oct 2015 14:06:28 +0000 (01:06 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Oct 2015 14:06:28 +0000 (01:06 +1100)
Without this you can't easily select a few nodes inside a frame,
without selecting the whole frame, noted in T46540

source/blender/editors/space_node/node_select.c

index 78302fedd97e9f5f5877312ee3c464b55327ff31..e2968b7003c01de91c57bd865991d16c8c3b77a8 100644 (file)
@@ -531,7 +531,15 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
        UI_view2d_region_to_view_rctf(&ar->v2d, &rectf, &rectf);
        
        for (node = snode->edittree->nodes.first; node; node = node->next) {
-               if (BLI_rctf_isect(&rectf, &node->totr, NULL)) {
+               bool select;
+               if (node->type == NODE_FRAME) {
+                       select = BLI_rctf_inside_rctf(&rectf, &node->totr);
+               }
+               else {
+                       select = BLI_rctf_isect(&rectf, &node->totr, NULL);
+               }
+
+               if (select) {
                        nodeSetSelected(node, (gesture_mode == GESTURE_MODAL_SELECT));
                }
                else if (!extend) {