Page MenuHome

Fix T100767: Geometry nodes viewer node placed incorrectly
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Sep 2 2022, 8:06 PM.

Details

Summary

I tried a few different solutions and simplifications to the uses of the node_add_node
function, but I still don't understand the coordinate spaces apparently, because
this solution is the best I came up with.

This patch is against the 3.3 branch.

Diff Detail

Repository
rB Blender

Event Timeline

With the suggested edit it seems good to me!

The socket location seems to be in view space, so dividing by UI_DPI_FAC brings them into the coordinate space of the node editor. This is consistent with what we're doing everywhere else with the cursor location before calling functions that add nodes.
The constant 100 x-offset for the node should already be in coordinate space though, so it does not have to be divided by UI_DPI_FAC anymore. Doing so means the offset of the viewer node varies depending on the UI Scale.


Here's the comparison:

display / UI Scalecurrent patchwith inline comment
1080p / 1.0
1080p / 2.0
retina / 1.0
retina / 2.0
source/blender/editors/space_node/node_relationships.cc
645
This revision is now accepted and ready to land.Sep 2 2022, 9:44 PM