Cleanup: Return early
This commit is contained in:
@@ -1727,8 +1727,10 @@ static int node_attach_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent
|
||||
SpaceNode &snode = *CTX_wm_space_node(C);
|
||||
bNodeTree &ntree = *snode.edittree;
|
||||
bNode *frame = node_find_frame_to_attach(region, ntree, event->mval);
|
||||
if (frame == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (frame) {
|
||||
LISTBASE_FOREACH_BACKWARD (bNode *, node, &ntree.nodes) {
|
||||
if (node->flag & NODE_SELECT) {
|
||||
if (node->parent == nullptr) {
|
||||
@@ -1757,7 +1759,6 @@ static int node_attach_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
node_sort(ntree);
|
||||
WM_event_add_notifier(C, NC_NODE | ND_DISPLAY, nullptr);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "BLI_lasso_2d.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_rect.h"
|
||||
#include "BLI_set.hh"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_string_search.h"
|
||||
#include "BLI_string_utf8.h"
|
||||
@@ -644,8 +645,10 @@ static bool node_mouse_select(bContext *C,
|
||||
}
|
||||
}
|
||||
|
||||
/* update node order */
|
||||
if (changed || found) {
|
||||
if (!(changed || found)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool active_texture_changed = false;
|
||||
bool viewer_node_changed = false;
|
||||
if ((node != nullptr) && (node_was_selected == false || params->select_passthrough == false)) {
|
||||
@@ -663,9 +666,8 @@ static bool node_mouse_select(bContext *C,
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_NODE | NA_SELECTED, nullptr);
|
||||
}
|
||||
|
||||
return changed || found;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int node_select_exec(bContext *C, wmOperator *op)
|
||||
|
||||
Reference in New Issue
Block a user