Skip to content

Commit

Permalink
Merge pull request #78996 from Tetane/create_shader_node_popup
Browse files Browse the repository at this point in the history
Fix "Create Shader Node" window position when visual shader editor is floating
  • Loading branch information
akien-mga committed Aug 21, 2023
2 parents 5444afa + 1cd0a34 commit 23db024
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/plugins/visual_shader_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3996,7 +3996,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos, VisualShaderNod
members_dialog->popup();

// Keep dialog within window bounds.
Rect2 window_rect = Rect2(DisplayServer::get_singleton()->window_get_position(), DisplayServer::get_singleton()->window_get_size());
Rect2 window_rect = Rect2(get_window()->get_position(), get_window()->get_size());
Rect2 dialog_rect = Rect2(members_dialog->get_position(), members_dialog->get_size());
Vector2 difference = (dialog_rect.get_end() - window_rect.get_end()).max(Vector2());
members_dialog->set_position(members_dialog->get_position() - difference);
Expand Down

0 comments on commit 23db024

Please sign in to comment.