using FairyGUI;

namespace NBF
{
    public static class GListExtensions
    {
        public static void AutoHeight(this GList list)
        {
            if (list.numItems < 1)
            {
                list.height = 100;
                return;
            }

            var item = list.GetChildAt(0);
            var listHeight = list.numItems * item.height + list.lineGap * list.numItems;
            list.height = listHeight;
        }
    }
}