From e35ff7d933dc750f4f2c7d15b04b8e1648f86519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Gonz=C3=A1lez?= Date: Wed, 12 Dec 2018 20:06:27 -0300 Subject: [PATCH] Fixed: when moving an element from a Reorderable List to another one that's empty, the element size was being reset to the default 100,100. This also happened is moving any element to the start of a it current list. --- Scripts/Controls/ReorderableList/ReorderableListElement.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/Controls/ReorderableList/ReorderableListElement.cs b/Scripts/Controls/ReorderableList/ReorderableListElement.cs index 29a4574..67a4fcd 100644 --- a/Scripts/Controls/ReorderableList/ReorderableListElement.cs +++ b/Scripts/Controls/ReorderableList/ReorderableListElement.cs @@ -88,6 +88,10 @@ namespace UnityEngine.UI.Extensions _fakeElement = new GameObject("Fake").AddComponent(); _fakeElementLE = _fakeElement.gameObject.AddComponent(); + //Set fake element initial size + _fakeElement.GetComponent().sizeDelta = _draggingObjectOriginalSize; + _fakeElementLE.preferredHeight = _draggingObjectLE.preferredHeight; + _fakeElementLE.preferredWidth = _draggingObjectLE.preferredWidth; RefreshSizes(); @@ -327,4 +331,4 @@ namespace UnityEngine.UI.Extensions _rect = GetComponent(); } } -} \ No newline at end of file +}