Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_select.c
| Show All 19 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup spnode | * \ingroup spnode | ||||
| */ | */ | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "BLI_listbase.h" | |||||
| #include "BLI_lasso_2d.h" | #include "BLI_lasso_2d.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_rect.h" | #include "BLI_rect.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_utf8.h" | #include "BLI_string_utf8.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| ▲ Show 20 Lines • Show All 581 Lines • ▼ Show 20 Lines | static int node_box_select_exec(bContext *C, wmOperator *op) | ||||
| UI_view2d_region_to_view_rctf(®ion->v2d, &rectf, &rectf); | UI_view2d_region_to_view_rctf(®ion->v2d, &rectf, &rectf); | ||||
| const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode"); | const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode"); | ||||
| const bool select = (sel_op != SEL_OP_SUB); | const bool select = (sel_op != SEL_OP_SUB); | ||||
| if (SEL_OP_USE_PRE_DESELECT(sel_op)) { | if (SEL_OP_USE_PRE_DESELECT(sel_op)) { | ||||
| ED_node_select_all(&snode->edittree->nodes, SEL_DESELECT); | ED_node_select_all(&snode->edittree->nodes, SEL_DESELECT); | ||||
| } | } | ||||
| for (bNode *node = snode->edittree->nodes.first; node; node = node->next) { | LISTBASE_FOREACH (bNode *, node, &snode->edittree->nodes) { | ||||
| bool is_inside; | bool is_inside; | ||||
| if (node->type == NODE_FRAME) { | if (node->type == NODE_FRAME) { | ||||
| is_inside = BLI_rctf_inside_rctf(&rectf, &node->totr); | is_inside = BLI_rctf_inside_rctf(&rectf, &node->totr); | ||||
| } | } | ||||
| else { | else { | ||||
| is_inside = BLI_rctf_isect(&rectf, &node->totr, NULL); | is_inside = BLI_rctf_isect(&rectf, &node->totr, NULL); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 596 Lines • Show Last 20 Lines | |||||