diff options
Diffstat (limited to 'editor/plugins/text_editor.cpp')
-rw-r--r-- | editor/plugins/text_editor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index e252792c43..cbde382d67 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -71,7 +71,7 @@ String TextEditor::get_name() { name = TTR("[unsaved]"); } else if (text_file->is_built_in()) { const String &text_file_name = text_file->get_name(); - if (text_file_name != "") { + if (!text_file_name.is_empty()) { // If the built-in text_file has a custom resource name defined, // display the built-in text_file name as follows: `ResourceName (scene_file.tscn)` name = vformat("%s (%s)", text_file_name, name.get_slice("::", 0)); @@ -507,7 +507,7 @@ void TextEditor::_make_context_menu(bool p_selection, bool p_can_fold, bool p_is 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_position)); + context_menu->set_position(get_screen_position() + p_position); context_menu->reset_size(); context_menu->popup(); } |