本文整理汇总了C++中LayoutBlockFlow::borderAndPaddingBefore方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBlockFlow::borderAndPaddingBefore方法的具体用法?C++ LayoutBlockFlow::borderAndPaddingBefore怎么用?C++ LayoutBlockFlow::borderAndPaddingBefore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBlockFlow
的用法示例。
在下文中一共展示了LayoutBlockFlow::borderAndPaddingBefore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: heightAdjustedForRowOffset
LayoutUnit MultiColumnFragmentainerGroup::heightAdjustedForRowOffset(LayoutUnit height) const
{
// Adjust for the top offset within the content box of the multicol container (containing
// block), unless we're in the first set. We know that the top offset for the first set will be
// zero, but if the multicol container has non-zero top border or padding, the set's top offset
// (initially being 0 and relative to the border box) will be negative until it has been laid
// out. Had we used this bogus offset, we would calculate the wrong height, and risk performing
// a wasted layout iteration. Of course all other sets (if any) have this problem in the first
// layout pass too, but there's really nothing we can do there until the flow thread has been
// laid out anyway.
if (m_columnSet.previousSiblingMultiColumnSet()) {
LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow();
LayoutUnit contentLogicalTop = m_columnSet.logicalTop() - multicolBlock->borderAndPaddingBefore();
height -= contentLogicalTop;
}
height -= logicalTop();
return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would probably cause an infinite amount of columns to be created.
}