summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegalobyte <megalobyte@protonmail.com>2021-03-31 22:27:24 -0700
committermegalobyte <megalobyte@protonmail.com>2021-03-31 22:28:08 -0700
commitd0f3817876db3b6872c105167e3d0cf71026e89b (patch)
tree4db33813d266cd3886913231181207d6ee13ce7b
parent7db85fffb50ef98dbf175189fba17a4d7dc85f5d (diff)
Use double when setting the default step size
Casting it as a float was causing issues with the progress bar
-rw-r--r--editor/editor_properties.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index f46d677aec..7b3ab4738a 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3282,7 +3282,7 @@ void EditorInspectorDefaultPlugin::parse_begin(Object *p_object) {
}
bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) {
- float default_float_step = EDITOR_GET("interface/inspector/default_float_step");
+ double default_float_step = EDITOR_GET("interface/inspector/default_float_step");
switch (p_type) {
// atomic types
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 81c59fc0a9..3d59f4bbc4 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1472,7 +1472,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
Vector3 ray_pos = _get_ray_pos(m->get_position());
Vector3 ray = _get_ray(m->get_position());
- float snap = EDITOR_GET("interface/inspector/default_float_step");
+ double snap = EDITOR_GET("interface/inspector/default_float_step");
int snap_step_decimals = Math::range_step_decimals(snap);
switch (_edit.mode) {
@@ -1766,7 +1766,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
Vector3 y_axis = (click - _edit.center).normalized();
Vector3 x_axis = plane.normal.cross(y_axis).normalized();
- float angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center));
+ double angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center));
if (_edit.snap || spatial_editor->is_snap_enabled()) {
snap = spatial_editor->get_rotate_snap();