public CachedMeasurement GetNextCachedMeasurement()
        {
            var cache = CachedMeasurements[NextCachedMeasurementsIndex];

            if (cache == null)
            {
                cache = CachedMeasurements[NextCachedMeasurementsIndex] = new CachedMeasurement();
            }
            NextCachedMeasurementsIndex++;
            return(cache);
        }
        public NodeLayout()
        {
            Direction = DirectionType.Inherit;
            ComputedFlexBasisGeneration = 0;
            ComputedFlexBasis           = null;
            HadOverflow     = false;
            GenerationCount = 0;

            LastOwnerDirection          = DirectionType.NotSet;
            NextCachedMeasurementsIndex = 0;

            for (var i = 0; i < MaxCachedResultCount; i++)
            {
                CachedMeasurements[i] = new CachedMeasurement();
            }
        }