Node Border Select: only frames inside border
[blender.git] / 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) {