本文整理汇总了C++中FloatingObject::type方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatingObject::type方法的具体用法?C++ FloatingObject::type怎么用?C++ FloatingObject::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatingObject
的用法示例。
在下文中一共展示了FloatingObject::type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
FloatingObject* FloatingObjects::add(PassOwnPtr<FloatingObject> floatingObject)
{
FloatingObject* newObject = floatingObject.leakPtr();
increaseObjectsCount(newObject->type());
m_set.add(adoptPtr(newObject));
if (newObject->isPlaced())
addPlacedObject(*newObject);
markLowestFloatLogicalBottomCacheAsDirty();
return newObject;
}
示例2: shrinkAvailableWidthForNewFloatIfNeeded
void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(const FloatingObject& newFloat)
{
if (!newFloatShrinksLine(newFloat, m_block, m_isFirstLine))
return;
#if ENABLE(CSS_SHAPES)
ShapeOutsideDeltas shapeDeltas;
if (ShapeOutsideInfo* shapeOutsideInfo = newFloat.renderer().shapeOutsideInfo()) {
LayoutUnit lineHeight = m_block.lineHeight(m_isFirstLine, m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine(m_block, newFloat, m_block.logicalHeight(), lineHeight);
}
#endif
if (newFloat.type() == FloatingObject::FloatLeft) {
float newLeft = m_block.logicalRightForFloat(newFloat);
if (shouldIndentText() == IndentText && m_block.style().isLeftToRightDirection())
newLeft += floorToInt(m_block.textIndentOffset());
#if ENABLE(CSS_SHAPES)
if (shapeDeltas.isValid()) {
if (shapeDeltas.lineOverlapsShape())
newLeft += shapeDeltas.rightMarginBoxDelta();
else // If the line doesn't overlap the shape, then we need to act as if this float didn't exist.
newLeft = m_left;
}
#endif
m_left = std::max<float>(m_left, newLeft);
} else {
float newRight = m_block.logicalLeftForFloat(newFloat);
if (shouldIndentText() == IndentText && !m_block.style().isLeftToRightDirection())
newRight -= floorToInt(m_block.textIndentOffset());
#if ENABLE(CSS_SHAPES)
if (shapeDeltas.isValid()) {
if (shapeDeltas.lineOverlapsShape())
newRight += shapeDeltas.leftMarginBoxDelta();
else // If the line doesn't overlap the shape, then we need to act as if this float didn't exist.
newRight = m_right;
}
#endif
m_right = std::min<float>(m_right, newRight);
}
computeAvailableWidthFromLeftAndRight();
}