diff options
Diffstat (limited to 'editor/script_editor_debugger.cpp')
| -rw-r--r-- | editor/script_editor_debugger.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 689bea2749..284b25801c 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -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; |