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.
parent
693a49997b
commit
e35ff7d933
|
@ -88,6 +88,10 @@ namespace UnityEngine.UI.Extensions
|
||||||
_fakeElement = new GameObject("Fake").AddComponent<RectTransform>();
|
_fakeElement = new GameObject("Fake").AddComponent<RectTransform>();
|
||||||
_fakeElementLE = _fakeElement.gameObject.AddComponent<LayoutElement>();
|
_fakeElementLE = _fakeElement.gameObject.AddComponent<LayoutElement>();
|
||||||
|
|
||||||
|
//Set fake element initial size
|
||||||
|
_fakeElement.GetComponent<RectTransform>().sizeDelta = _draggingObjectOriginalSize;
|
||||||
|
_fakeElementLE.preferredHeight = _draggingObjectLE.preferredHeight;
|
||||||
|
_fakeElementLE.preferredWidth = _draggingObjectLE.preferredWidth;
|
||||||
|
|
||||||
RefreshSizes();
|
RefreshSizes();
|
||||||
|
|
||||||
|
@ -327,4 +331,4 @@ namespace UnityEngine.UI.Extensions
|
||||||
_rect = GetComponent<RectTransform>();
|
_rect = GetComponent<RectTransform>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue