当前位置: 首页>>代码示例>>C++>>正文


C++ LayoutBlockFlow::borderAndPaddingBefore方法代码示例

本文整理汇总了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.
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:18,代码来源:MultiColumnFragmentainerGroup.cpp


注:本文中的LayoutBlockFlow::borderAndPaddingBefore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。