The edge source and destination positions are based on the real node position which is not necessarily the same as the window. It should be, and was once, but the positions are rounded. I'd like to have a single source of truth but the window positions are rounded and this negatively affects the force directed layout simulation.
As a result the egui::Window position only sets the node position when it's being dragged. Unfortunately this not only results in inconsistent positions, but also nodes that can be off screen. Suggested fixes? Set the node position from the window position in more cases, such as when any of the points of the bounding rectangle are outside the viewport bounds. Also set on node creation.
Or we can try to increase the forces so the rounding doesn't matter so much. In this case the rounding could act as a cutoff. Experimentation is needed.
The edge source and destination positions are based on the real node position which is not necessarily the same as the window. It should be, and was once, but the positions are rounded. I'd like to have a single source of truth but the window positions are rounded and this negatively affects the force directed layout simulation.
As a result the
egui::Window
position only sets the node position when it's being dragged. Unfortunately this not only results in inconsistent positions, but also nodes that can be off screen. Suggested fixes? Set the node position from the window position in more cases, such as when any of the points of the bounding rectangle are outside the viewport bounds. Also set on node creation.Or we can try to increase the forces so the rounding doesn't matter so much. In this case the rounding could act as a cutoff. Experimentation is needed.