internal static float?AdjustFloatedBlockLayoutBox(AbstractRenderer renderer, Rectangle parentBBox, float? blockWidth, IList <Rectangle> floatRendererAreas, FloatPropertyValue?floatPropertyValue, OverflowPropertyValue? overflowX) { renderer.SetProperty(Property.HORIZONTAL_ALIGNMENT, null); float floatElemWidth; bool overflowFit = AbstractRenderer.IsOverflowFit(overflowX); if (blockWidth != null) { floatElemWidth = (float)blockWidth + AbstractRenderer.CalculateAdditionalWidth(renderer); if (overflowFit && floatElemWidth > parentBBox.GetWidth()) { floatElemWidth = parentBBox.GetWidth(); } } else { MinMaxWidth minMaxWidth = CalculateMinMaxWidthForFloat(renderer, floatPropertyValue); float maxWidth = minMaxWidth.GetMaxWidth(); if (maxWidth > parentBBox.GetWidth()) { maxWidth = parentBBox.GetWidth(); } if (!overflowFit && minMaxWidth.GetMinWidth() > parentBBox.GetWidth()) { maxWidth = minMaxWidth.GetMinWidth(); } floatElemWidth = maxWidth + AbstractRenderer.EPS; blockWidth = maxWidth - minMaxWidth.GetAdditionalWidth() + AbstractRenderer.EPS; } AdjustBlockAreaAccordingToFloatRenderers(floatRendererAreas, parentBBox, floatElemWidth, FloatPropertyValue .LEFT.Equals(floatPropertyValue)); return(blockWidth); }
protected internal override AbstractRenderer CreateOverflowRenderer(int layoutResult) { AbstractRenderer overflowRenderer = base.CreateOverflowRenderer(layoutResult); overflowRenderer.SetProperty(Property.LIST_SYMBOLS_INITIALIZED, true); return(overflowRenderer); }
protected internal override AbstractRenderer CreateSplitRenderer(int layoutResult) { AbstractRenderer splitRenderer = base.CreateSplitRenderer(layoutResult); splitRenderer.AddAllProperties(GetOwnProperties()); splitRenderer.SetProperty(Property.LIST_SYMBOLS_INITIALIZED, true); return(splitRenderer); }
internal static MinMaxWidth CalculateMinMaxWidthForFloat(AbstractRenderer renderer, FloatPropertyValue?floatPropertyVal ) { bool floatPropIsRendererOwn = renderer.HasOwnProperty(Property.FLOAT); renderer.SetProperty(Property.FLOAT, FloatPropertyValue.NONE); MinMaxWidth kidMinMaxWidth = renderer.GetMinMaxWidth(); if (floatPropIsRendererOwn) { renderer.SetProperty(Property.FLOAT, floatPropertyVal); } else { renderer.DeleteOwnProperty(Property.FLOAT); } return(kidMinMaxWidth); }