Ejemplo n.º 1
0
        protected virtual void CalculateChild(ILayout childLayout, float x, float y, float contentWidth, float contentHeight, float absoluteX, float absoluteY)
        {
            // check if item has a percentual width
            var calcedWidth = childLayout.HasPercentualWidth ? contentWidth * childLayout.PercentualWidth : childLayout.GetCalculatedWidth();
            // check if item hat a percentual height
            var calcedHeight = childLayout.HasPercentualHeight ? contentHeight * childLayout.PercentualHeight : childLayout.GetCalculatedHeight();

            var processingData = childLayout.GetProcessingData();

            processingData.SetAbsoluteGeometry(absoluteX, absoluteY, calcedWidth, calcedHeight);
            processingData.SetDrawingGeometry(x, y, calcedWidth, calcedHeight);
            processingData.SetClipRect(absoluteX, absoluteY, calcedWidth, calcedHeight);

            if (childLayout is IContainerLayout)
            {
                ((IContainerLayout)childLayout).CalculateChildLayouts(x, y, calcedWidth, calcedHeight, absoluteX, absoluteY);
            }
        }