diff options
Diffstat (limited to 'editor/script_editor_debugger.cpp')
-rw-r--r-- | editor/script_editor_debugger.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 621ab039f4..3b086c6316 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -727,20 +727,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da String tt = vs; switch (Performance::MonitorType((int)perf_items[i]->get_metadata(1))) { case Performance::MONITOR_TYPE_MEMORY: { - // for the time being, going above GBs is a bad sign. - String unit = "B"; - if ((int)v > 1073741824) { - unit = "GB"; - v /= 1073741824.0; - } else if ((int)v > 1048576) { - unit = "MB"; - v /= 1048576.0; - } else if ((int)v > 1024) { - unit = "KB"; - v /= 1024.0; - } - tt += " bytes"; - vs = String::num(v, 2) + " " + unit; + vs = String::humanize_size(v); + tt = vs; } break; case Performance::MONITOR_TYPE_TIME: { tt += " seconds"; @@ -1025,7 +1013,9 @@ void ScriptEditorDebugger::_performance_draw() { int pi = which[i]; Color c = get_color("accent_color", "Editor"); float h = (float)which[i] / (float)(perf_items.size()); - c.set_hsv(Math::fmod(h + 0.4, 0.9), c.get_s() * 0.9, c.get_v() * 1.4); + // Use a darker color on light backgrounds for better visibility + float value_multiplier = EditorSettings::get_singleton()->is_dark_theme() ? 1.4 : 0.55; + c.set_hsv(Math::fmod(h + 0.4, 0.9), c.get_s() * 0.9, c.get_v() * value_multiplier); c.a = 0.6; perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x); @@ -1045,9 +1035,8 @@ void ScriptEditorDebugger::_performance_draw() { float h2 = E->get()[pi] / m; h2 = (1.0 - h2) * r.size.y; - c.a = 0.7; if (E != perf_history.front()) - perf_draw->draw_line(r.position + Point2(from, h2), r.position + Point2(from + spacing, prev), c, 2.0); + perf_draw->draw_line(r.position + Point2(from, h2), r.position + Point2(from + spacing, prev), c, Math::round(EDSCALE), true); prev = h2; E = E->next(); from -= spacing; |