From 0b11062d9360080f6861c51097c551b4ea485550 Mon Sep 17 00:00:00 2001 From: Geequlim Date: Mon, 31 Jul 2017 14:15:38 +0800 Subject: [PATCH] Fix property type expose of Control.stretch_ratio. Fix set integer value from inspector to round instead of floor. --- editor/property_editor.cpp | 2 +- scene/gui/control.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 71afa8ac79c..1d91d9a8853 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -3859,7 +3859,7 @@ void PropertyEditor::_item_edited() { break; if (type == Variant::INT) - _edit_set(name, int(item->get_range(1)), refresh_all); + _edit_set(name, round(item->get_range(1)), refresh_all); else _edit_set(name, item->get_range(1), refresh_all); } break; diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ee908428d9b..ca81b72e89e 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2536,7 +2536,7 @@ void Control::_bind_methods() { ADD_GROUP("Size Flags", "size_flags_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_h_size_flags", "get_h_size_flags"); ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_v_size_flags", "get_v_size_flags"); - ADD_PROPERTYNO(PropertyInfo(Variant::INT, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), "set_stretch_ratio", "get_stretch_ratio"); + ADD_PROPERTYNO(PropertyInfo(Variant::REAL, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_stretch_ratio", "get_stretch_ratio"); ADD_GROUP("Theme", ""); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme", "get_theme"); ADD_GROUP("", "");