Exemplo n.º 1
0
		/// <summary>Lets the renderer know that the given parent element has finished
		/// packing all of its kids. This allows alignment to occur next.</summary>
		/// <param name="element">The element that is done packing.</param>
		public void EndLinePack(Element element){
			ComputedStyle computed=element.Style.Computed;
			CompleteLine(computed);
			
			if(!computed.FixedHeight){
				computed.InnerHeight=PenY;
				computed.SetPixelHeight(true);
				
				if(element.VScrollbar){
					// This if is an optimisation.
					// We don't normally have e.g. 100% high in a non-fixed height element - only scrollbars do that.
					element.SetHeightForKids(computed);
				}
			}
			
			computed.ContentHeight=PenY;
			computed.ContentWidth=LargestLineWidth;
			
			if(element.HScrollbar){
				computed.ContentHeight+=14;
			}
			
			if(element.VScrollbar && computed.WhiteSpace==WhiteSpaceType.Normal){
				computed.ContentWidth+=14;
			}
			
			if(!computed.FixedWidth&&computed.Display!=DisplayType.Block){
				computed.InnerWidth=LargestLineWidth;
				computed.SetPixelWidth(true);
				
				if(element.HScrollbar){
					// This IF is an optimisation. See reason above.
					element.SetWidthForKids(computed);
				}
			}
			
			if(element.VerticalScrollbar!=null){
				element.VerticalScrollbar.RecalculateTab();
				DoLayout=false;
			}
			
			if(element.HorizontalScrollbar!=null){
				element.HorizontalScrollbar.RecalculateTab();
				DoLayout=false;
			}
			
			// Next, perform any horizontal alignment.
			
			// Clear active floating element set:
			if(ActiveFloats!=null){
				
				// Got a set - clear it:
				ActiveFloats.Clear();
				
			}
			
			// This must be done here as we don't know the full width/height of the element until after EndLinePack.
			HorizontalAlign(element);
			
			// Remove the active float set:
			ActiveFloats=null;
			
		}