Reproduction
Create new document
Open node graph
Right click to add new node near the bottom of the node graph view
Select node
Observe it is added not in the location of the right click.
Video
add_in_wrong_place.mp4
Code
A shifted version of the mouse position is used to spawn the node instead of the proper position.
// TODO: Create function
let node_graph_shift = if matches ! ( context_menu_data, ContextMenuData :: CreateNode { compatible_type: None } ) {
let appear_right_of_mouse = if click. x > viewport. size ( ) . x ( ) - 180. { -180. } else { 0. } ;
let appear_above_mouse = if click. y > viewport. size ( ) . y ( ) - 200. { -200. } else { 0. } ;
DVec2 :: new ( appear_right_of_mouse, appear_above_mouse) / network_metadata. persistent_metadata . navigation_metadata . node_graph_to_viewport . matrix2 . x_axis . x
} else {
let appear_right_of_mouse = if click. x > viewport. size ( ) . x ( ) - 173. { -173. } else { 0. } ;
let appear_above_mouse = if click. y > viewport. size ( ) . y ( ) - 34. { -34. } else { 0. } ;
DVec2 :: new ( appear_right_of_mouse, appear_above_mouse) / network_metadata. persistent_metadata . navigation_metadata . node_graph_to_viewport . matrix2 . x_axis . x
} ;
editor .createNode (identifier , $nodeGraph .contextMenuInformation .contextMenuCoordinates [0 ], $nodeGraph .contextMenuInformation .contextMenuCoordinates [1 ]);
Reproduction
Video
add_in_wrong_place.mp4
Code
A shifted version of the mouse position is used to spawn the node instead of the proper position.
Graphite/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs
Lines 866 to 875 in 2c29d2c
Graphite/frontend/src/components/views/Graph.svelte
Line 142 in 2c29d2c