mirror of
https://github.com/godotengine/godot.git
synced 2025-10-25 18:54:43 +00:00
New shader nodes are now created under (more or less) the cursor.
This commit is contained in:
parent
1469508174
commit
ded1acc33e
4 changed files with 10 additions and 5 deletions
|
|
@ -2658,13 +2658,13 @@ void ShaderGraphEditor::edit(Ref<ShaderGraph> p_shader) {
|
|||
void ShaderGraphEditor::_add_node(int p_type) {
|
||||
|
||||
ShaderGraph::ShaderType shader_type=ShaderGraph::ShaderType(tabs->get_current_tab());
|
||||
|
||||
graph_edits[shader_type]->add_node(p_type, next_location);
|
||||
}
|
||||
|
||||
void ShaderGraphEditor::_popup_requested(const Vector2 &p_position)
|
||||
{
|
||||
next_location = get_local_mouse_pos();
|
||||
Vector2 scroll_ofs=graph_edits[tabs->get_current_tab()]->get_graph_edit()->get_scroll_ofs();
|
||||
next_location = get_local_mouse_pos() + scroll_ofs;
|
||||
popup->set_global_pos(p_position);
|
||||
popup->set_size( Size2( 200, 0) );
|
||||
popup->popup();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue