本文整理汇总了C++中FloatingObject::layoutObject方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatingObject::layoutObject方法的具体用法?C++ FloatingObject::layoutObject怎么用?C++ FloatingObject::layoutObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatingObject
的用法示例。
在下文中一共展示了FloatingObject::layoutObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fitBelowFloats
void LineWidth::fitBelowFloats(bool isFirstLine) {
ASSERT(!m_committedWidth);
ASSERT(!fitsOnLine());
m_block.positionNewFloats(m_block.logicalHeight(), this);
LayoutUnit floatLogicalBottom;
LayoutUnit lastFloatLogicalBottom = m_block.logicalHeight();
LayoutUnit newLineWidth = m_availableWidth;
LayoutUnit newLineLeft = m_left;
LayoutUnit newLineRight = m_right;
FloatingObject* lastFloatFromPreviousLine =
m_block.lastFloatFromPreviousLine();
if (lastFloatFromPreviousLine &&
lastFloatFromPreviousLine->layoutObject()->shapeOutsideInfo())
return wrapNextToShapeOutside(isFirstLine);
while (true) {
floatLogicalBottom =
m_block.nextFloatLogicalBottomBelow(lastFloatLogicalBottom);
if (floatLogicalBottom <= lastFloatLogicalBottom)
break;
newLineWidth = availableWidthAtOffset(
m_block, floatLogicalBottom, indentText(), newLineLeft, newLineRight);
lastFloatLogicalBottom = floatLogicalBottom;
if (newLineWidth >= m_uncommittedWidth)
break;
}
updateLineDimension(lastFloatLogicalBottom, LayoutUnit(newLineWidth),
newLineLeft, newLineRight);
}
示例2: shrinkAvailableWidthForNewFloatIfNeeded
void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(
const FloatingObject& newFloat) {
LayoutUnit height = m_block.logicalHeight();
if (height < m_block.logicalTopForFloat(newFloat) ||
height >= m_block.logicalBottomForFloat(newFloat))
return;
ShapeOutsideDeltas shapeDeltas;
if (ShapeOutsideInfo* shapeOutsideInfo =
newFloat.layoutObject()->shapeOutsideInfo()) {
LayoutUnit lineHeight = m_block.lineHeight(
m_isFirstLine,
m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine,
PositionOfInteriorLineBoxes);
shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine(
m_block, newFloat, m_block.logicalHeight(), lineHeight);
}
if (newFloat.getType() == FloatingObject::FloatLeft) {
LayoutUnit newLeft = m_block.logicalRightForFloat(newFloat);
if (shapeDeltas.isValid()) {
if (shapeDeltas.lineOverlapsShape()) {
newLeft += shapeDeltas.rightMarginBoxDelta();
} else {
// Per the CSS Shapes spec, If the line doesn't overlap the shape, then
// ignore this shape for this line.
newLeft = m_left;
}
}
if (indentText() == IndentText && m_block.style()->isLeftToRightDirection())
newLeft += floorToInt(m_block.textIndentOffset());
m_left = std::max(m_left, newLeft);
} else {
LayoutUnit newRight = m_block.logicalLeftForFloat(newFloat);
if (shapeDeltas.isValid()) {
if (shapeDeltas.lineOverlapsShape()) {
newRight += shapeDeltas.leftMarginBoxDelta();
} else {
// Per the CSS Shapes spec, If the line doesn't overlap the shape, then
// ignore this shape for this line.
newRight = m_right;
}
}
if (indentText() == IndentText &&
!m_block.style()->isLeftToRightDirection())
newRight -= floorToInt(m_block.textIndentOffset());
m_right = std::min(m_right, newRight);
}
computeAvailableWidthFromLeftAndRight();
}
示例3:
inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded(const FloatingObject& floatingObject)
{
LayoutUnit logicalLeft = m_layoutObject->logicalLeftForFloat(floatingObject);
if (ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOutsideInfo()) {
ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainingBlockLine(LineLayoutBlockFlow(const_cast<LayoutBlockFlow*>(m_layoutObject)), floatingObject, m_lineTop, m_lineBottom - m_lineTop);
if (!shapeDeltas.lineOverlapsShape())
return false;
logicalLeft += shapeDeltas.leftMarginBoxDelta();
}
if (logicalLeft < m_offset) {
m_offset = logicalLeft;
return true;
}
return false;
}