From e826db2b018009ce12119a897da06b6edeee73fd Mon Sep 17 00:00:00 2001 From: RSlysz Date: Wed, 17 Mar 2021 19:22:26 +0100 Subject: [PATCH] fix pivot edit mode 2D slider gizmo not supporting multi-edition (decal) --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Editor/Material/Decal/ProjectedTransform.cs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index af9ed9c5bc9..dcec2a877b7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -110,6 +110,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed warning fixed on ShadowLoop include (HDRISky and Unlit+ShadowMatte) - Fixed SSR Precision for 4K Screens - Fixed issue with gbuffer debug view when virtual texturing is enabled. +- Fixed Decal's pivot edit mode 2D slider gizmo not supporting multi-edition ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ProjectedTransform.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ProjectedTransform.cs index 5b1dcc86277..4f16f49d1c4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ProjectedTransform.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ProjectedTransform.cs @@ -194,17 +194,18 @@ public static Vector3 DrawHandles(Vector3 position, float zProjectionDistance, Q verts[1] = sliderFaceProjected + (-Vector3.right + Vector3.up) * size2D; verts[2] = sliderFaceProjected + (-Vector3.right - Vector3.up) * size2D; verts[3] = sliderFaceProjected + (Vector3.right - Vector3.up) * size2D; + int id = GUIUtility.GetControlID(ids.xy, FocusType.Passive); float faceOpacity = 0.8f; - if (GUIUtility.hotControl == ids.xy) + if (GUIUtility.hotControl == id) Handles.color = Handles.selectedColor; - else if (IsHovering(ids.xy, Event.current)) + else if (IsHovering(id, Event.current)) faceOpacity = 0.4f; else faceOpacity = 0.1f; Color faceColor = new Color(Handles.zAxisColor.r, Handles.zAxisColor.g, Handles.zAxisColor.b, Handles.zAxisColor.a * faceOpacity); Handles.DrawSolidRectangleWithOutline(verts, faceColor, Color.clear); EditorGUI.BeginChangeCheck(); - sliderFaceProjected = Handles.Slider2D(ids.xy, sliderFaceProjected, Vector3.forward, Vector3.right, Vector3.up, size2D, Handles.RectangleHandleCap, s_IsGridSnappingActive() ? Vector2.zero : new Vector2(EditorSnapSettings.move[0], EditorSnapSettings.move[1]), false); + sliderFaceProjected = Handles.Slider2D(id, sliderFaceProjected, Vector3.forward, Vector3.right, Vector3.up, size2D, Handles.RectangleHandleCap, s_IsGridSnappingActive() ? Vector2.zero : new Vector2(EditorSnapSettings.move[0], EditorSnapSettings.move[1]), false); if (EditorGUI.EndChangeCheck()) { sliderRotatedWorldPos.x = sliderFaceProjected.x;