From e29931b22a835b951a75789f31d162d8674e3582 Mon Sep 17 00:00:00 2001 From: Suchaaver Chahal Date: Mon, 9 Oct 2017 22:34:29 -0700 Subject: [PATCH 1/2] change step to .01 for float --- editor/property_editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 658f67d6a47..3bc78642465 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -376,7 +376,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: if (hint == PROPERTY_HINT_RANGE) { int c = hint_text.get_slice_count(","); - float min = 0, max = 100, step = 1; + float min = 0, max = 100, step = .01; if (c >= 1) { if (!hint_text.get_slice(",", 0).empty()) @@ -3032,7 +3032,7 @@ void PropertyEditor::update_tree() { if (p.hint == PROPERTY_HINT_SPRITE_FRAME || p.hint == PROPERTY_HINT_RANGE || p.hint == PROPERTY_HINT_EXP_RANGE) { int c = p.hint_string.get_slice_count(","); - float min = 0, max = 100, step = 1; + float min = 0, max = 100, step = .01; if (c >= 1) { min = p.hint_string.get_slice(",", 0).to_double(); From 02c7566b50f1e533852100b66cb20ec1a8f44b30 Mon Sep 17 00:00:00 2001 From: Suchaaver Chahal Date: Sat, 14 Oct 2017 12:20:04 -0700 Subject: [PATCH 2/2] keep display int if int range --- editor/property_editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 3bc78642465..b7cc9347f29 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -376,7 +376,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: if (hint == PROPERTY_HINT_RANGE) { int c = hint_text.get_slice_count(","); - float min = 0, max = 100, step = .01; + float min = 0, max = 100, step = type == Variant::REAL ? .01 : 1; if (c >= 1) { if (!hint_text.get_slice(",", 0).empty()) @@ -3032,7 +3032,7 @@ void PropertyEditor::update_tree() { if (p.hint == PROPERTY_HINT_SPRITE_FRAME || p.hint == PROPERTY_HINT_RANGE || p.hint == PROPERTY_HINT_EXP_RANGE) { int c = p.hint_string.get_slice_count(","); - float min = 0, max = 100, step = .01; + float min = 0, max = 100, step = p.type == Variant::REAL ? .01 : 1; if (c >= 1) { min = p.hint_string.get_slice(",", 0).to_double();