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).

This commit is contained in:
Relintai 2022-03-16 21:37:03 +01:00
parent c1ebd9905a
commit 2c1eb4182b

View File

@ -583,7 +583,16 @@ void EditorHelp::_update_doc() {
class_desc->pop(); class_desc->pop();
class_desc->push_color(value_color); 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->pop();
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);