diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-10-11 09:10:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-11 09:10:00 +0200 |
commit | 8b54cfad1d903fef4c12862271c91c86d2f28e56 (patch) | |
tree | 376d08e852dc153b3777cf93ebb2c04ea8039db1 | |
parent | f3106cddb38259f74846edd43b85208b99e3414a (diff) | |
parent | 7b293aa4d412c938b56d8996dab04232d3c40e2e (diff) |
Merge pull request #6776 from RandomShaper/int_property_step
Allow step for integer properties
-rw-r--r-- | tools/editor/property_editor.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 7163836f73..f18d5c928a 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -328,26 +328,26 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty if (c>=2) { if (!hint_text.get_slice(",",1).empty()) - max=hint_text.get_slice(",",1).to_double(); + max=hint_text.get_slice(",",1).to_double(); } - if (type==Variant::REAL && c>=3) { + if (c>=3) { if (!hint_text.get_slice(",",2).empty()) - step= hint_text.get_slice(",",2).to_double(); + step= hint_text.get_slice(",",2).to_double(); } if (c>=4 && hint_text.get_slice(",",3)=="slider") { slider->set_min(min); slider->set_max(max); - slider->set_step((type==Variant::REAL) ? step : 1); + slider->set_step(step); slider->set_val(v); slider->show(); set_size(Size2(110,30)*EDSCALE); } else { spinbox->set_min(min); spinbox->set_max(max); - spinbox->set_step((type==Variant::REAL) ? step : 1); + spinbox->set_step(step); spinbox->set_val(v); spinbox->show(); set_size(Size2(70,35)*EDSCALE); @@ -3258,7 +3258,7 @@ void PropertyEditor::update_tree() { max=p.hint_string.get_slice(",",1).to_double(); } - if (p.type==Variant::REAL && c>=3) { + if (p.type!=PROPERTY_HINT_SPRITE_FRAME && c>=3) { step= p.hint_string.get_slice(",",2).to_double(); } |