diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/rich_text_label.cpp | 9 | ||||
-rw-r--r-- | scene/gui/rich_text_label.h | 1 | ||||
-rw-r--r-- | scene/resources/environment.cpp | 6 | ||||
-rw-r--r-- | scene/resources/environment.h | 12 |
4 files changed, 19 insertions, 9 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 4865b9770e..86e5afcb7c 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -4157,6 +4157,14 @@ int RichTextLabel::get_content_height() const { return total_height; } +int RichTextLabel::get_content_width() const { + int total_width = 0; + for (int i = 0; i < main->lines.size(); i++) { + total_width = MAX(total_width, main->lines[i].offset.x + main->lines[i].text_buf->get_size().x); + } + return total_width; +} + #ifndef DISABLE_DEPRECATED // People will be very angry, if their texts get erased, because of #39148. (3.x -> 4.0) // Although some people may not used bbcode_text, so we only overwrite, if bbcode_text is not empty. @@ -4279,6 +4287,7 @@ void RichTextLabel::_bind_methods() { ClassDB::bind_method(D_METHOD("get_visible_paragraph_count"), &RichTextLabel::get_visible_paragraph_count); ClassDB::bind_method(D_METHOD("get_content_height"), &RichTextLabel::get_content_height); + ClassDB::bind_method(D_METHOD("get_content_width"), &RichTextLabel::get_content_width); ClassDB::bind_method(D_METHOD("parse_expressions_for_values", "expressions"), &RichTextLabel::parse_expressions_for_values); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index e79244f2e4..ea3a08d7bd 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -554,6 +554,7 @@ public: int get_visible_line_count() const; int get_content_height() const; + int get_content_width() const; VScrollBar *get_v_scroll_bar() { return vscroll; } diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index b13ae9d016..bf17a6ea97 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1332,7 +1332,7 @@ void Environment::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sdfgi_min_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_sdfgi_min_cell_size", "get_sdfgi_min_cell_size"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sdfgi_cascade0_distance", PROPERTY_HINT_RANGE, "0.1,16384,0.1,or_greater"), "set_sdfgi_cascade0_distance", "get_sdfgi_cascade0_distance"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sdfgi_max_distance", PROPERTY_HINT_RANGE, "0.1,16384,0.1,or_greater"), "set_sdfgi_max_distance", "get_sdfgi_max_distance"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "sdfgi_y_scale", PROPERTY_HINT_ENUM, "Disable,75%,50%"), "set_sdfgi_y_scale", "get_sdfgi_y_scale"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "sdfgi_y_scale", PROPERTY_HINT_ENUM, "50% (Compact),75% (Balanced),100% (Sparse)"), "set_sdfgi_y_scale", "get_sdfgi_y_scale"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sdfgi_energy"), "set_sdfgi_energy", "get_sdfgi_energy"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sdfgi_normal_bias"), "set_sdfgi_normal_bias", "get_sdfgi_normal_bias"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sdfgi_probe_bias"), "set_sdfgi_probe_bias", "get_sdfgi_probe_bias"); @@ -1511,9 +1511,9 @@ void Environment::_bind_methods() { BIND_ENUM_CONSTANT(GLOW_BLEND_MODE_REPLACE); BIND_ENUM_CONSTANT(GLOW_BLEND_MODE_MIX); - BIND_ENUM_CONSTANT(SDFGI_Y_SCALE_DISABLED); - BIND_ENUM_CONSTANT(SDFGI_Y_SCALE_75_PERCENT); BIND_ENUM_CONSTANT(SDFGI_Y_SCALE_50_PERCENT); + BIND_ENUM_CONSTANT(SDFGI_Y_SCALE_75_PERCENT); + BIND_ENUM_CONSTANT(SDFGI_Y_SCALE_100_PERCENT); } Environment::Environment() { diff --git a/scene/resources/environment.h b/scene/resources/environment.h index b04723a221..dd1e664ca6 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -71,9 +71,9 @@ public: }; enum SDFGIYScale { - SDFGI_Y_SCALE_DISABLED, - SDFGI_Y_SCALE_75_PERCENT, SDFGI_Y_SCALE_50_PERCENT, + SDFGI_Y_SCALE_75_PERCENT, + SDFGI_Y_SCALE_100_PERCENT, }; enum GlowBlendMode { @@ -147,12 +147,12 @@ private: // SDFGI bool sdfgi_enabled = false; - int sdfgi_cascades = 6; + int sdfgi_cascades = 4; float sdfgi_min_cell_size = 0.2; - SDFGIYScale sdfgi_y_scale = SDFGI_Y_SCALE_DISABLED; + SDFGIYScale sdfgi_y_scale = SDFGI_Y_SCALE_75_PERCENT; bool sdfgi_use_occlusion = false; - float sdfgi_bounce_feedback = 0.0; - bool sdfgi_read_sky_light = false; + float sdfgi_bounce_feedback = 0.5; + bool sdfgi_read_sky_light = true; float sdfgi_energy = 1.0; float sdfgi_normal_bias = 1.1; float sdfgi_probe_bias = 1.1; |