[Bf-blender-cvs] [7047bd41c6f] master: UI: Change computation of node socket position to align with label

Dominik Fill noreply at git.blender.org
Tue Feb 8 04:59:55 CET 2022


Commit: 7047bd41c6f4aa3b2c34909e00fcfdb6fca44c9c
Author: Dominik Fill
Date:   Tue Feb 8 14:55:02 2022 +1100
Branches: master
https://developer.blender.org/rB7047bd41c6f4aa3b2c34909e00fcfdb6fca44c9c

UI: Change computation of node socket position to align with label

This Diff changes the computation of the input and output socket
position to being always aligned with its corresponding label.

Reviewed By: campbellbarton

Ref D14025

===================================================================

M	source/blender/editors/space_node/node_draw.cc

===================================================================

diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 81c63e9bddb..2ab0a3fff44 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -397,7 +397,7 @@ static void node_update_basis(const bContext &C, bNodeTree &ntree, bNode &node,
 
     /* Round the socket location to stop it from jiggling. */
     nsock->locx = round(loc.x + NODE_WIDTH(node));
-    nsock->locy = round(0.5f * (dy + buty));
+    nsock->locy = round(dy - NODE_DYS);
 
     dy = buty;
     if (nsock->next) {
@@ -527,7 +527,7 @@ static void node_update_basis(const bContext &C, bNodeTree &ntree, bNode &node,
 
     nsock->locx = loc.x;
     /* Round the socket vertical position to stop it from jiggling. */
-    nsock->locy = round(0.5f * (dy + buty));
+    nsock->locy = round(dy - NODE_DYS);
 
     dy = buty - multi_input_socket_offset * 0.5;
     if (nsock->next) {



More information about the Bf-blender-cvs mailing list