本文整理汇总了C++中LayoutBlock::size方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBlock::size方法的具体用法?C++ LayoutBlock::size怎么用?C++ LayoutBlock::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBlock
的用法示例。
在下文中一共展示了LayoutBlock::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeInitialPositionAdjustment
LayoutUnit SnapToLinesLayouter::computeInitialPositionAdjustment(LayoutUnit& step) const
{
// 6. Let line position be the text track cue computed line position.
// 7. Round line position to an integer by adding 0.5 and then flooring it.
LayoutUnit linePosition = floorf(m_linePosition + 0.5f);
WritingMode writingMode = m_cueBox.style()->writingMode();
// 8. Vertical Growing Left: Add one to line position then negate it.
if (writingMode == RightToLeftWritingMode)
linePosition = -(linePosition + 1);
// 9. Let position be the result of multiplying step and line position.
LayoutUnit position = step * linePosition;
// 10. Vertical Growing Left: Decrease position by the width of the
// bounding box of the boxes in boxes, then increase position by step.
if (writingMode == RightToLeftWritingMode) {
position -= m_cueBox.size().width();
position += step;
}
// 11. If line position is less than zero...
if (linePosition < 0) {
LayoutBlock* parentBlock = m_cueBox.containingBlock();
// Horizontal / Vertical: ... then increase position by the
// height / width of the video's rendering area ...
position += blink::isHorizontalWritingMode(writingMode) ? parentBlock->size().height() : parentBlock->size().width();
// ... and negate step.
step = -step;
}
return position;
}