diff --git a/Editor/CUIImageEditor.cs b/Editor/CUIImageEditor.cs index c961d07..a3eb6f1 100644 --- a/Editor/CUIImageEditor.cs +++ b/Editor/CUIImageEditor.cs @@ -68,7 +68,12 @@ namespace UnityEngine.UI.Extensions Handles.color = Color.gray; EditorGUI.BeginChangeCheck(); +#if UNITY_2022_1_OR_NEWER + Vector3 newCornerPos = Handles.FreeMoveHandle(script.transform.TransformPoint(cornerPos), HandleUtility.GetHandleSize(script.transform.TransformPoint(cornerPos)) / 7, Vector3.one, Handles.SphereHandleCap); +#else Vector3 newCornerPos = Handles.FreeMoveHandle(script.transform.TransformPoint(cornerPos), script.transform.rotation, HandleUtility.GetHandleSize(script.transform.TransformPoint(cornerPos)) / 7, Vector3.one, Handles.SphereHandleCap); +#endif + Handles.Label(newCornerPos, string.Format("Corner Mover")); newCornerPos = script.transform.InverseTransformPoint(newCornerPos); diff --git a/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs b/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs index dbdc39b..60cd5f4 100644 --- a/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs +++ b/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs @@ -1,6 +1,7 @@ /// Credit Titinious (https://github.com/Titinious) /// Sourced from - https://github.com/Titinious/CurlyUI +using System.Collections; using System.Collections.Generic; #if UNITY_EDITOR @@ -286,6 +287,13 @@ namespace UnityEngine.UI.Extensions public void Refresh() { + StartCoroutine(RefreshOnNextFrame()); + } + + public IEnumerator RefreshOnNextFrame() + { + yield return new WaitForEndOfFrame(); + ReportSet(); // we use local position as the true value. Ratio position follows it, so it should be updated when refresh