summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-25 08:32:28 +0200
committerGitHub <noreply@github.com>2019-07-25 08:32:28 +0200
commit6c21ce736798d50be35ad36a196b70b52e6d93ed (patch)
treec90d3d9cd696d21c9a5507afccced3d89d671897 /editor
parenteb300ba8fe48a76d31b97564eb34c58c355cdbd5 (diff)
parenta2c4e4d6ff6e87c0d0542f7701c79673c71f6e2a (diff)
Merge pull request #30803 from YeldhamDev/debugger_monitor_text_center
Center text in the debugger's "Monitors" tab
Diffstat (limited to 'editor')
-rw-r--r--editor/script_editor_debugger.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 0c280b16b2..f2b9b15b49 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1009,7 +1009,10 @@ void ScriptEditorDebugger::_performance_draw() {
Ref<Font> graph_font = get_font("font", "TextEdit");
if (which.empty()) {
- perf_draw->draw_string(graph_font, Point2(0, graph_font->get_ascent()), TTR("Pick one or more items from the list to display the graph."), get_color("font_color", "Label"), perf_draw->get_size().x);
+ String text = TTR("Pick one or more items from the list to display the graph.");
+
+ perf_draw->draw_string(graph_font, Point2(MAX(0, perf_draw->get_size().x - graph_font->get_string_size(text).x), perf_draw->get_size().y + graph_font->get_ascent()) / 2, text, get_color("font_color", "Label"), perf_draw->get_size().x);
+
return;
}