From 7ede2504032933ce8ff089e89632cacdb1f65d84 Mon Sep 17 00:00:00 2001 From: Zode Date: Mon, 17 Jun 2024 22:59:19 +0300 Subject: [PATCH] absolute snapping: actually fix large world this time --- Source/Editor/Gizmo/TransformGizmoBase.cs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Source/Editor/Gizmo/TransformGizmoBase.cs b/Source/Editor/Gizmo/TransformGizmoBase.cs index 1715a5b02..2ce601d1e 100644 --- a/Source/Editor/Gizmo/TransformGizmoBase.cs +++ b/Source/Editor/Gizmo/TransformGizmoBase.cs @@ -343,20 +343,10 @@ namespace FlaxEditor.Gizmo _hasAbsoluteSnapped = true; Vector3 currentTranslationScale = isScaling ? GetSelectedTransform(0).Scale : GetSelectedTransform(0).Translation; - if(LargeWorlds.Enable) - { - absoluteDelta = currentTranslationScale - new Vector3( - Double.Round(currentTranslationScale.X / snapValue.X) * snapValue.X, - Double.Round(currentTranslationScale.Y / snapValue.Y) * snapValue.Y, - Double.Round(currentTranslationScale.Z / snapValue.Z) * snapValue.Z); - } - else - { - absoluteDelta = currentTranslationScale - new Vector3( - Mathf.Round(currentTranslationScale.X / snapValue.X) * snapValue.X, - Mathf.Round(currentTranslationScale.Y / snapValue.Y) * snapValue.Y, - Mathf.Round(currentTranslationScale.Z / snapValue.Z) * snapValue.Z); - } + absoluteDelta = currentTranslationScale - new Vector3( + (Real)Math.Round(currentTranslationScale.X / snapValue.X) * snapValue.X, + (Real)Math.Round(currentTranslationScale.Y / snapValue.Y) * snapValue.Y, + (Real)Math.Round(currentTranslationScale.Z / snapValue.Z) * snapValue.Z); } delta = new Vector3(