From 63b91381abd1d698884d1ae7a94c4819b0b05514 Mon Sep 17 00:00:00 2001 From: Uumutunal Date: Thu, 12 Dec 2024 11:37:24 +0300 Subject: [PATCH] Fix 3D editor snap setting values not being displayed correctly --- editor/plugins/node_3d_editor_plugin.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index f0008406958e..037c165d43f6 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -6629,9 +6629,12 @@ void Node3DEditor::_snap_changed() { } void Node3DEditor::_snap_update() { - snap_translate->set_text(String::num(snap_translate_value)); - snap_rotate->set_text(String::num(snap_rotate_value)); - snap_scale->set_text(String::num(snap_scale_value)); + double snap = EDITOR_GET("interface/inspector/default_float_step"); + int snap_step_decimals = Math::range_step_decimals(snap); + + snap_translate->set_text(String::num(snap_translate_value, snap_step_decimals)); + snap_rotate->set_text(String::num(snap_rotate_value, snap_step_decimals)); + snap_scale->set_text(String::num(snap_scale_value, snap_step_decimals)); } void Node3DEditor::_xform_dialog_action() {