GetAbsoluteChildBoxIter() public method

public GetAbsoluteChildBoxIter ( ) : IEnumerable
return IEnumerable
Esempio n. 1
0
        static void LayoutContentInAbsoluteLayer(LayoutVisitor lay, CssBox srcBox)
        {
            if (srcBox.JustTempContainer) return;
            var ifonts = lay.SampleIFonts;
            //css3 jan2015: absolute position
            //use offset relative to its normal the box's containing box***

            float containerW = lay.LatestContainingBlock.VisualWidth;
            float maxRight = 0;
            float maxBottom = 0;
            foreach (var b in srcBox.GetAbsoluteChildBoxIter())
            {
                if (b.JustTempContainer)
                {
                    continue;
                }

                if (b.NeedComputedValueEvaluation)
                {
                    b.ReEvaluateComputedValues(ifonts, lay.LatestContainingBlock);
                }

                b.MeasureRunsSize(lay);
                PerformContentLayout(b, lay);
                b.SetLocation(
                     CssValueParser.ConvertToPx(b.Left, containerW, b),
                     CssValueParser.ConvertToPx(b.Top, containerW, b));
                var localRight = b.LocalVisualRight;
                var localBottom = b.LocalVisualBottom;
                if (maxRight < localRight)
                {
                    maxRight = localRight;
                }
                if (maxBottom < localBottom)
                {
                    maxBottom = localBottom;
                }
            }

            int i_maxRight = (int)maxRight;
            int i_maxBottom = (int)maxBottom;
            srcBox.InnerContentWidth = i_maxRight;
            srcBox.InnerContentHeight = i_maxBottom;
        }