本文整理汇总了C#中TheArtOfDev.HtmlRenderer.Core.Dom.CssBox.GetMaximumBottom方法的典型用法代码示例。如果您正苦于以下问题:C# CssBox.GetMaximumBottom方法的具体用法?C# CssBox.GetMaximumBottom怎么用?C# CssBox.GetMaximumBottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TheArtOfDev.HtmlRenderer.Core.Dom.CssBox
的用法示例。
在下文中一共展示了CssBox.GetMaximumBottom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyCellVerticalAlignment
/// <summary>
/// Applies special vertical alignment for table-cells
/// </summary>
/// <param name="g"></param>
/// <param name="cell"></param>
public static void ApplyCellVerticalAlignment(RGraphics g, CssBox cell)
{
ArgChecker.AssertArgNotNull(g, "g");
ArgChecker.AssertArgNotNull(cell, "cell");
if (cell.VerticalAlign == CssConstants.Top || cell.VerticalAlign == CssConstants.Baseline)
return;
double cellbot = cell.ClientBottom;
double bottom = cell.GetMaximumBottom(cell, 0f);
double dist = 0f;
if (cell.VerticalAlign == CssConstants.Bottom)
{
dist = cellbot - bottom;
}
else if (cell.VerticalAlign == CssConstants.Middle)
{
dist = (cellbot - bottom) / 2;
}
foreach (CssBox b in cell.Boxes)
{
b.OffsetTop(dist);
}
//float top = cell.ClientTop;
//float bottom = cell.ClientBottom;
//bool middle = cell.VerticalAlign == CssConstants.Middle;
//foreach (LineBox line in cell.LineBoxes)
//{
// for (int i = 0; i < line.RelatedBoxes.Count; i++)
// {
// double diff = bottom - line.RelatedBoxes[i].Rectangles[line].Bottom;
// if (middle) diff /= 2f;
// RectangleF r = line.RelatedBoxes[i].Rectangles[line];
// line.RelatedBoxes[i].Rectangles[line] = new RectangleF(r.X, r.Y + diff, r.Width, r.Height);
// }
// foreach (BoxWord word in line.Words)
// {
// double gap = word.Top - top;
// word.Top = bottom - gap - word.Height;
// }
//}
}