From f101afbb299853b3678ffccc6dc58455682b840d Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Thu, 21 Oct 2021 13:48:44 +0100 Subject: [PATCH 1/2] Clean up range slider unused variables --- Runtime/Scripts/Controls/RangeSlider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Runtime/Scripts/Controls/RangeSlider.cs b/Runtime/Scripts/Controls/RangeSlider.cs index 4477017..b43401a 100644 --- a/Runtime/Scripts/Controls/RangeSlider.cs +++ b/Runtime/Scripts/Controls/RangeSlider.cs @@ -532,7 +532,6 @@ namespace UnityEngine.UI.Extensions //HANDLE DRAG EVENTS m_LowOffset = m_HighOffset = Vector2.zero; - Vector2 localMousePos; if(m_LowHandleRect != null && LowValue == MaxValue && RectTransformUtility.RectangleContainsScreenPoint(m_LowHandleRect, eventData.position, eventData.enterEventCamera)) { SetToMoveLowValueHandle(m_LowHandleRect, eventData); From 056419a87ba76d1c03b0f94179e4ab1586f48b41 Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Thu, 21 Oct 2021 13:57:42 +0100 Subject: [PATCH 2/2] Updated Dropdown list to NOT resize text Rect on draw --- Runtime/Scripts/Controls/ComboBox/DropDownList.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Runtime/Scripts/Controls/ComboBox/DropDownList.cs b/Runtime/Scripts/Controls/ComboBox/DropDownList.cs index 2e3b23a..8b33cf7 100644 --- a/Runtime/Scripts/Controls/ComboBox/DropDownList.cs +++ b/Runtime/Scripts/Controls/ComboBox/DropDownList.cs @@ -74,13 +74,15 @@ namespace UnityEngine.UI.Extensions [SerializeField] private bool _displayPanelAbove = false; + [SerializeField] + [Tooltip("Override the Text width for the values.")] + private bool _overrideTextWidth = true; + [System.Serializable] - public class SelectionChangedEvent : UnityEngine.Events.UnityEvent { - } + public class SelectionChangedEvent : UnityEngine.Events.UnityEvent { } // fires when item is changed; public SelectionChangedEvent OnSelectionChanged; - public void Start() { Initialize(); @@ -332,7 +334,10 @@ namespace UnityEngine.UI.Extensions _hasDrawnOnce = true; _mainButton.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, _rectTransform.sizeDelta.x); _mainButton.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, _rectTransform.sizeDelta.y); - _mainButton.txt.rectTransform.offsetMax = new Vector2(4, 0); + if (_overrideTextWidth) + { + _mainButton.txt.rectTransform.offsetMax = new Vector2(4, 0); + } _scrollPanelRT.SetParent(transform, true);//break the scroll panel from the overlay _scrollPanelRT.anchoredPosition = _displayPanelAbove ?