Skip to content

Commit

Permalink
Fix some popups menu missing screen transform.
Browse files Browse the repository at this point in the history
  • Loading branch information
reduz authored and MarcusElg committed Oct 19, 2020
1 parent 8be16e0 commit 9b02151
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) {
tree_popup->clear();
tree_popup->set_size(Size2(1, 1));
_file_and_folders_fill_popup(tree_popup, paths);
tree_popup->set_position(tree->get_global_position() + p_pos);
tree_popup->set_position(tree->get_screen_position() + p_pos);
tree_popup->popup();
}
}
Expand Down
2 changes: 1 addition & 1 deletion editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
}

menu->set_size(Size2(1, 1));
menu->set_position(p_menu_pos);
menu->set_position(get_screen_position() + p_menu_pos);
menu->popup();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion editor/scene_tree_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ void SceneTreeEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data,
}

void SceneTreeEditor::_rmb_select(const Vector2 &p_pos) {
emit_signal("rmb_pressed", tree->get_global_transform().xform(p_pos));
emit_signal("rmb_pressed", tree->get_screen_transform().xform(p_pos));
}

void SceneTreeEditor::_warning_changed(Node *p_for_node) {
Expand Down
2 changes: 1 addition & 1 deletion scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {

if (b.is_valid()) {
if (b->is_pressed() && b->get_button_index() == BUTTON_RIGHT && context_menu_enabled) {
menu->set_position(get_global_transform().xform(get_local_mouse_position()));
menu->set_position(get_screen_transform().xform(get_local_mouse_position()));
menu->set_size(Vector2(1, 1));
//menu->set_scale(get_global_transform().get_scale());
menu->popup();
Expand Down

0 comments on commit 9b02151

Please sign in to comment.