private Rect DrawLayoutListField(int controlID, IReorderableListAdaptor adaptor)
{
float totalHeight;
// Calculate position of list field using layout engine.
if (Event.current.type == EventType.Layout) {
totalHeight = CalculateListHeight(adaptor);
s_ContainerHeightCache[controlID] = totalHeight;
}
else {
totalHeight = s_ContainerHeightCache.ContainsKey(controlID)
? s_ContainerHeightCache[controlID]
: 0;
}
Rect position = GUILayoutUtility.GetRect(GUIContent.none, containerStyle, GUILayout.Height(totalHeight));
// Make room for add button?
if (hasAddButton)
position.height -= addButtonStyle.fixedHeight;
// Draw list as normal.
DrawListContainerAndItems(position, controlID, adaptor);
CheckForAutoFocusControl(controlID);
return position;
}