summaryrefslogtreecommitdiff
path: root/editor/script_editor_debugger.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-08-27 02:10:03 +0200
committerGitHub <noreply@github.com>2017-08-27 02:10:03 +0200
commite8345c824e361a3e6ca0e5dca384ad1856127bb7 (patch)
treec26c5e4a879aaae917238f9398ba8e1f9aac395f /editor/script_editor_debugger.cpp
parentfe26bcd8c6d5434d9299a668581dfdb5b51351c7 (diff)
parent473695ab47190f39abfc131cb70bb71766a772d2 (diff)
Merge pull request #10657 from Noshyaar/pr-debug
Monitor: add hint, fix certain graph not drawn
Diffstat (limited to 'editor/script_editor_debugger.cpp')
-rw-r--r--editor/script_editor_debugger.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 689bea2749..d1d9f86b66 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;