summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-25 10:33:45 +0200
committerGitHub <noreply@github.com>2019-07-25 10:33:45 +0200
commit1481d299ea97fa1311a75a9ee39eb97d624a8619 (patch)
treec42928f05a4050fdb6d5eb8361469e423fd80e76 /scene
parentffca740185d5e34dbb41af825aeb4d04407894e1 (diff)
parentd844e306147689c3f02473b3dd5d592bdf141023 (diff)
Merge pull request #30776 from akien-mga/editor-configurable-float-step
Inspector: Make default float step configurable
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/spin_box.cpp2
-rw-r--r--scene/gui/tree.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 279253889c..db277d3705 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -40,7 +40,7 @@ Size2 SpinBox::get_minimum_size() const {
void SpinBox::_value_changed(double) {
- String value = String::num(get_value(), Math::step_decimals(get_step()));
+ String value = String::num(get_value(), Math::range_step_decimals(get_step()));
if (prefix != "")
value = prefix + " " + value;
if (suffix != "")
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 814100afdc..81f2f46a80 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1315,7 +1315,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
Ref<Texture> updown = cache.updown;
- String valtext = String::num(p_item->cells[i].val, Math::step_decimals(p_item->cells[i].step));
+ String valtext = String::num(p_item->cells[i].val, Math::range_step_decimals(p_item->cells[i].step));
//String valtext = rtos( p_item->cells[i].val );
if (p_item->cells[i].suffix != String())
@@ -1926,7 +1926,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
} else {
- editor_text = String::num(p_item->cells[col].val, Math::step_decimals(p_item->cells[col].step));
+ editor_text = String::num(p_item->cells[col].val, Math::range_step_decimals(p_item->cells[col].step));
if (select_mode == SELECT_MULTI && get_tree()->get_event_count() == focus_in_id)
bring_up_editor = false;
}
@@ -2755,7 +2755,7 @@ bool Tree::edit_selected() {
text_editor->set_position(textedpos);
text_editor->set_size(rect.size);
text_editor->clear();
- text_editor->set_text(c.mode == TreeItem::CELL_MODE_STRING ? c.text : String::num(c.val, Math::step_decimals(c.step)));
+ text_editor->set_text(c.mode == TreeItem::CELL_MODE_STRING ? c.text : String::num(c.val, Math::range_step_decimals(c.step)));
text_editor->select_all();
if (c.mode == TreeItem::CELL_MODE_RANGE) {