From 2c1eb4182b02d9edf4147772ba6a05f02b537448 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 16 Mar 2022 21:37:03 +0100 Subject: [PATCH] Limit property default value in the editor's docs, to fix formatting for properties that return lots of data by default (Like Entity's sresources). --- editor/editor_help.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index ae3e1f628..d520d5306 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -583,7 +583,16 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->push_color(value_color); - _add_text(_fix_constant(cd.properties[i].default_value)); + + String default_text = _fix_constant(cd.properties[i].default_value); + + //limit length to a reasonable value, as too much text breaks formatting. + if (default_text.size() > 30) { + default_text.resize(30); + default_text += "... "; + } + + _add_text(default_text); class_desc->pop(); class_desc->push_color(symbol_color);