Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2022-01-05 14:32:00 +0300
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:29:17 +0300
commite4db04b279c92fa3c35e9c436df2be1d41797233 (patch)
tree617e389d6de8a8a96bdbb30ca2e6001878a02baa /source/blender/editors/space_node/node_draw.cc
parent61df6343d54bc0ac4413433d9246521e45f43ad9 (diff)
Fix T94415: Nodes: poor selection behavior inside frame nodes
Previously, node selection made no distinction between a frame node and other nodes. So a frame node would be selected by their whole rect or center (depending on box/lasso/circle select). As a consequence of this, box and lasso could not pratically be started inside a frame node (with the intention to select a subset of contained child nodes) because the frame would be selected immediately and tweak-transforming started. Circle selecting would always contain the frame node as well (making transforming a subset of nodes without also transforming the whole frame impossible). Now change selection behavior so that for all selection modes only the border [the margin area that is automatically added around all nodes, see note below] of a frame node is considered in selection. This makes for a much more intuitive experience when arranging nodes inside frames. note: to make the area of interest for selection/moving more obvious, the cursor changes when hovering over (as is done for resizing). note: this also makes the resize margin consistent with other nodes. note: this also fixes right resize border (was exclusive instead of inclusive as every other border) Also fixes T46540.
Diffstat (limited to 'source/blender/editors/space_node/node_draw.cc')
-rw-r--r--source/blender/editors/space_node/node_draw.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 2ab0a3fff44..e290316af1f 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -2272,6 +2272,13 @@ void node_set_cursor(wmWindow &win, SpaceNode &snode, const float2 &cursor)
if (node) {
NodeResizeDirection dir = node_get_resize_direction(node, cursor[0], cursor[1]);
wmcursor = node_get_resize_cursor(dir);
+ /* We want to indicate that Frame nodes can be moved/selected on their borders. */
+ if (node->type == NODE_FRAME && dir == NODE_RESIZE_NONE) {
+ const rctf frame_inside = node_frame_rect_inside(*node);
+ if (!BLI_rctf_isect_pt(&frame_inside, cursor[0], cursor[1])) {
+ wmcursor = WM_CURSOR_NSEW_SCROLL;
+ }
+ }
}
WM_cursor_set(&win, wmcursor);