Fix T103624: Last node is skipped for cursor and link picking
I wrote the reverse iteration incorrectly in e091291b5b.
This commit is contained in:
@@ -2601,7 +2601,7 @@ static const bNode *find_node_under_cursor(SpaceNode &snode, const float2 &curso
|
||||
{
|
||||
/* Check nodes front to back. */
|
||||
const Span<bNode *> nodes = snode.edittree->all_nodes();
|
||||
for (int i = nodes.index_range().last(); i > 0; i--) {
|
||||
for (int i = nodes.index_range().last(); i >= 0; i--) {
|
||||
if (BLI_rctf_isect_pt(&nodes[i]->runtime->totr, cursor[0], cursor[1])) {
|
||||
return nodes[i];
|
||||
}
|
||||
|
||||
@@ -1130,7 +1130,7 @@ bNodeSocket *node_find_indicated_socket(SpaceNode &snode,
|
||||
snode.edittree->ensure_topology_cache();
|
||||
|
||||
const Span<bNode *> nodes = snode.edittree->all_nodes();
|
||||
for (int i = nodes.index_range().last(); i > 0; i--) {
|
||||
for (int i = nodes.index_range().last(); i >= 0; i--) {
|
||||
bNode &node = *nodes[i];
|
||||
|
||||
BLI_rctf_init_pt_radius(&rect, cursor, size_sock_padded);
|
||||
|
||||
Reference in New Issue
Block a user