diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-19 17:56:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 17:56:48 +0200 |
commit | aef7a3178fb141bbbfafb52b275851ad70bab5a0 (patch) | |
tree | a1014a129ce7a0b4e8a0ff0271008b6ea13faeeb /scene/resources | |
parent | 23950cec35d1f7e4bc7dde86057fb6758d6afe20 (diff) | |
parent | 69c039ffab70cb9b5e723f1146dc7808b8a6e86a (diff) |
Merge pull request #10444 from toger5/styleBoxFlat_corner_detail_value_limitation
styleBoxFlat: clamp corner_detail + aa_size
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/style_box.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index f03f7fddeb..d6a730647f 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -463,7 +463,7 @@ bool StyleBoxFlat::is_anti_aliased() const { } void StyleBoxFlat::set_aa_size(const int &p_aa_size) { - aa_size = p_aa_size; + aa_size = CLAMP(p_aa_size, 1, 5); emit_changed(); } int StyleBoxFlat::get_aa_size() const { @@ -471,7 +471,7 @@ int StyleBoxFlat::get_aa_size() const { } void StyleBoxFlat::set_corner_detail(const int &p_corner_detail) { - corner_detail = p_corner_detail; + corner_detail = CLAMP(p_corner_detail, 1, 128); emit_changed(); } int StyleBoxFlat::get_corner_detail() const { @@ -777,7 +777,7 @@ void StyleBoxFlat::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::INT, "corner_radius_bottom_right", PROPERTY_HINT_RANGE, "0,1024,1"), "set_corner_radius", "get_corner_radius", CORNER_BOTTOM_RIGHT); ADD_PROPERTYI(PropertyInfo(Variant::INT, "corner_radius_bottom_left", PROPERTY_HINT_RANGE, "0,1024,1"), "set_corner_radius", "get_corner_radius", CORNER_BOTTOM_LEFT); - ADD_PROPERTY(PropertyInfo(Variant::INT, "corner_detail"), "set_corner_detail", "get_corner_detail"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "corner_detail", PROPERTY_HINT_RANGE, "1,128,1"), "set_corner_detail", "get_corner_detail"); ADD_GROUP("Expand Margin", "expand_margin_"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_LEFT); |