diff options
| author | Poommetee Ketson | 2017-08-26 23:02:52 +0700 |
|---|---|---|
| committer | Poommetee Ketson | 2017-08-26 23:02:52 +0700 |
| commit | 473695ab47190f39abfc131cb70bb71766a772d2 (patch) | |
| tree | 6609f2dec2a0007604108fdf58db5bc767758ea0 /editor | |
| parent | 1894157c9fab05984428d83a743b0fe1d720c80c (diff) | |
| download | godot-473695ab47190f39abfc131cb70bb71766a772d2.tar.gz godot-473695ab47190f39abfc131cb70bb71766a772d2.tar.zst godot-473695ab47190f39abfc131cb70bb71766a772d2.zip | |
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/script_editor_debugger.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 689bea274..d1d9f86b6 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -789,14 +789,17 @@ void ScriptEditorDebugger::_performance_draw() { which.push_back(i); } - if (which.empty()) + 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); return; + } Ref<StyleBox> graph_sb = get_stylebox("normal", "TextEdit"); - Ref<Font> graph_font = get_font("font", "TextEdit"); int cols = Math::ceil(Math::sqrt((float)which.size())); - int rows = (which.size() + 1) / cols; + int rows = Math::ceil((float)which.size() / cols); if (which.size() == 1) rows = 1; |
