summaryrefslogtreecommitdiff
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-06 16:05:10 +0100
committerGitHub <noreply@github.com>2021-12-06 16:05:10 +0100
commite8082003f19ad8d98b6b2f74f64f4eaa7fe86353 (patch)
tree59ac76c6766279ce53f7b274053db8ca5d0d4fd8 /editor/plugins/script_text_editor.cpp
parent78fd56a5968e7618f2a39f2759ead4c41b36734a (diff)
parent81efebb3a170dd6194905599361c38ae4246c434 (diff)
Merge pull request #52280 from jmb462/fix-bad-popup-offset-with-single-window-off
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 30a4cef8ca..66b803e3ab 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1611,7 +1611,7 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) {
float alpha = color.size() > 3 ? color[3] : 1.0f;
color_picker->set_pick_color(Color(color[0], color[1], color[2], alpha));
}
- color_panel->set_position(get_global_transform().xform(local_pos));
+ color_panel->set_position(get_screen_position() + local_pos);
} else {
has_color = false;
}
@@ -1688,7 +1688,7 @@ void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color, bool p
context_menu->set_item_disabled(context_menu->get_item_index(EDIT_UNDO), !tx->has_undo());
context_menu->set_item_disabled(context_menu->get_item_index(EDIT_REDO), !tx->has_redo());
- context_menu->set_position(get_global_transform().xform(p_pos));
+ context_menu->set_position(get_screen_position() + p_pos);
context_menu->reset_size();
context_menu->popup();
}