From 749d8b87047be5c9b923401bea677cbebb8074f7 Mon Sep 17 00:00:00 2001 From: CortiWins Date: Thu, 23 Oct 2025 19:25:54 +0200 Subject: [PATCH 1/3] TextureMoveTool - SnapIncrement on Sliders Fix Class: TextureMoveTool Method: DoToolUI Snapping is done by using EditorSnapping.MoveSnap on the moved position. There are three handles - Slider2D - Slider1D Up ( Green arrow) - Slider1D Right (RedArrow) The Slider2D has an explicit individual snap value of 0.0f. The Slider1Ds use a method override that internally applies -1.0f as a snap factor. The position done via Slider1D is snapped to 1.0 increments before getting to the MoveSnap line where the acutual snap settings are applied. --- Editor/EditorCore/TextureMoveTool.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Editor/EditorCore/TextureMoveTool.cs b/Editor/EditorCore/TextureMoveTool.cs index 8228767e3..ece0c0051 100644 --- a/Editor/EditorCore/TextureMoveTool.cs +++ b/Editor/EditorCore/TextureMoveTool.cs @@ -39,7 +39,6 @@ protected override void DoToolGUI() { if (!isEditing) m_Position = Vector3.zero; - EditorHandleUtility.PushMatrix(); Handles.matrix = Matrix4x4.TRS(m_HandlePosition, m_HandleRotation, Vector3.one); @@ -48,22 +47,25 @@ protected override void DoToolGUI() Handles.color = Color.blue; + // Disable Snap for the individual handles. Snap is applied if movement is detected. + const float SnapFactor = 0.0f; + m_Position = Handles.Slider2D(m_Position, Vector3.forward, Vector3.right, Vector3.up, HandleUtility.GetHandleSize(m_Position) * .2f, Handles.RectangleHandleCap, - 0f, + SnapFactor, false); Handles.color = Color.green; - m_Position = Handles.Slider(m_Position, Vector3.up); + m_Position = Handles.Slider(m_Position, Vector3.up, HandleUtility.GetHandleSize(m_Position), Handles.ArrowHandleCap, SnapFactor); Handles.color = Color.red; - m_Position = Handles.Slider(m_Position, Vector3.right); + m_Position = Handles.Slider(m_Position, Vector3.right, HandleUtility.GetHandleSize(m_Position), Handles.ArrowHandleCap, SnapFactor); Handles.color = Color.white; From 5ff619bf4c0815141ac19efcf9b69b27b188d313 Mon Sep 17 00:00:00 2001 From: CortiWins Date: Thu, 23 Oct 2025 19:31:16 +0200 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22b6dba09..da0747bcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Fixed a big where in the TextureMoveTool, a snapping of 1.0f was applied to handle movement before the actual snapping is applied - [PBLD-240] Fixed a bug where buttons for "Create Cube" and "Create PolyShape" appeared incorrectly on Light theme. - [PBLD-258] Fixed an bug where clicking a highlighted edge might select a hidden edge instead. - [PBLD-262] Fixed a bug in the deep cycling of face selection where faces from hidden meshes would get prioritized From 76ec2c972eefe9d928808ba49ad9b4d637f9020f Mon Sep 17 00:00:00 2001 From: CortiWins Date: Thu, 23 Oct 2025 19:51:20 +0200 Subject: [PATCH 3/3] Minor Fixes , thx UnityBot --- CHANGELOG.md | 2 +- Editor/EditorCore/TextureMoveTool.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da0747bcf..a4f9e6402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed -- Fixed a big where in the TextureMoveTool, a snapping of 1.0f was applied to handle movement before the actual snapping is applied +- Fixed a bug where in the TextureMoveTool, a snapping of 1.0f was applied to handle movement before the actual snapping is applied - [PBLD-240] Fixed a bug where buttons for "Create Cube" and "Create PolyShape" appeared incorrectly on Light theme. - [PBLD-258] Fixed an bug where clicking a highlighted edge might select a hidden edge instead. - [PBLD-262] Fixed a bug in the deep cycling of face selection where faces from hidden meshes would get prioritized diff --git a/Editor/EditorCore/TextureMoveTool.cs b/Editor/EditorCore/TextureMoveTool.cs index ece0c0051..aeb2c90ab 100644 --- a/Editor/EditorCore/TextureMoveTool.cs +++ b/Editor/EditorCore/TextureMoveTool.cs @@ -49,23 +49,24 @@ protected override void DoToolGUI() // Disable Snap for the individual handles. Snap is applied if movement is detected. const float SnapFactor = 0.0f; + var handleSize = HandleUtility.GetHandleSize(m_Position); m_Position = Handles.Slider2D(m_Position, Vector3.forward, Vector3.right, Vector3.up, - HandleUtility.GetHandleSize(m_Position) * .2f, + handleSize * .2f, Handles.RectangleHandleCap, SnapFactor, false); Handles.color = Color.green; - m_Position = Handles.Slider(m_Position, Vector3.up, HandleUtility.GetHandleSize(m_Position), Handles.ArrowHandleCap, SnapFactor); + m_Position = Handles.Slider(m_Position, Vector3.up, handleSize, Handles.ArrowHandleCap, SnapFactor); Handles.color = Color.red; - m_Position = Handles.Slider(m_Position, Vector3.right, HandleUtility.GetHandleSize(m_Position), Handles.ArrowHandleCap, SnapFactor); + m_Position = Handles.Slider(m_Position, Vector3.right, handleSize, Handles.ArrowHandleCap, SnapFactor); Handles.color = Color.white;