A LayoutTransform contains the information that a Box needs to transform points in its own coordinate system (or possibly its container's coordinate system) into points relative to the view as a whole. This class is immutable; if you need a different one, make a new one.
Ejemplo n.º 1
0
 /// <summary>
 /// The gap at the top of the box (margin + border + pad) in layout pixels.
 /// </summary>
 internal int GapTrailing(LayoutTransform trans)
 {
     // Convert each separately to avoid rounding errors.
     return(trans.MpToPixelsY(Style.Margins.TrailingMp)
            + trans.MpToBorderPixelsY(Style.Borders.TrailingMp)
            + trans.MpToPixelsY(Style.Pads.TrailingMp));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// The sum of the top and bottom gaps, that is, how much higher a box is because of
 /// its top and bottom margin, border, and pad.
 /// </summary>
 /// <param name="trans"></param>
 /// <returns></returns>
 internal int SurroundHeight(LayoutTransform trans)
 {
     return(GapTop(trans) + GapBottom(trans));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// The sum of the leading and trailing gaps, that is, how much wider a box is because of
 /// its leading and trailing margin, border, and pad.
 /// </summary>
 /// <param name="trans"></param>
 /// <returns></returns>
 internal int SurroundWidth(LayoutTransform trans)
 {
     return(GapLeading(trans) + GapTrailing(trans));
 }
Ejemplo n.º 4
0
		public LayoutInfo(LayoutTransform source, int maxWidth, IVwGraphics graphics, IRendererFactory rf)
			: this(source.XOffset, source.YOffset, source.DpiX, source.DpiY, maxWidth, graphics, rf)
		{
		}
Ejemplo n.º 5
0
		/// <summary>
		/// The sum of the top and bottom gaps, that is, how much higher a box is because of
		/// its top and bottom margin, border, and pad.
		/// </summary>
		/// <param name="trans"></param>
		/// <returns></returns>
		internal int SurroundHeight(LayoutTransform trans)
		{
			return GapTop(trans) + GapBottom(trans);
		}
Ejemplo n.º 6
0
		/// <summary>
		/// The sum of the leading and trailing gaps, that is, how much wider a box is because of
		/// its leading and trailing margin, border, and pad.
		/// </summary>
		/// <param name="trans"></param>
		/// <returns></returns>
		internal int SurroundWidth(LayoutTransform trans)
		{
			return GapLeading(trans) + GapTrailing(trans);
		}
Ejemplo n.º 7
0
		/// <summary>
		/// The gap at the top of the box (margin + border + pad) in layout pixels.
		/// </summary>
		internal int GapTrailing(LayoutTransform trans)
		{
			// Convert each separately to avoid rounding errors.
			return trans.MpToPixelsY(Style.Margins.TrailingMp)
				   + trans.MpToBorderPixelsY(Style.Borders.TrailingMp)
				   + trans.MpToPixelsY(Style.Pads.TrailingMp);
		}
Ejemplo n.º 8
0
 public LayoutInfo(LayoutTransform source, int maxWidth, IVwGraphics graphics, IRendererFactory rf)
     : this(source.XOffset, source.YOffset, source.DpiX, source.DpiY, maxWidth, graphics, rf)
 {
 }