本文整理汇总了C++中GridPosition::spanPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ GridPosition::spanPosition方法的具体用法?C++ GridPosition::spanPosition怎么用?C++ GridPosition::spanPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridPosition
的用法示例。
在下文中一共展示了GridPosition::spanPosition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: definiteGridSpanWithNamedLineSpanAgainstOpposite
static GridSpan definiteGridSpanWithNamedLineSpanAgainstOpposite(int oppositeLine, const GridPosition& position, GridPositionSide side, unsigned lastLine, NamedLineCollection& linesCollection)
{
int start, end;
if (side == RowStartSide || side == ColumnStartSide) {
start = lookBackForNamedGridLine(oppositeLine - 1, position.spanPosition(), lastLine, linesCollection);
end = oppositeLine;
} else {
start = oppositeLine;
end = lookAheadForNamedGridLine(oppositeLine + 1, position.spanPosition(), lastLine, linesCollection);
}
return GridSpan::untranslatedDefiniteGridSpan(start, end);
}
示例2: resolveNamedGridLinePositionAgainstOppositePosition
static GridSpan resolveNamedGridLinePositionAgainstOppositePosition(const RenderStyle& gridContainerStyle, int oppositeLine, const GridPosition& position, GridPositionSide side, unsigned autoRepeatTracksCount)
{
ASSERT(position.isSpan());
ASSERT(!position.namedGridLine().isNull());
// Negative positions are not allowed per the specification and should have been handled during parsing.
ASSERT(position.spanPosition() > 0);
unsigned lastLine = explicitGridSizeForSide(gridContainerStyle, side, autoRepeatTracksCount);
NamedLineCollection linesCollection(gridContainerStyle, position.namedGridLine(), directionFromSide(side), lastLine, autoRepeatTracksCount);
return definiteGridSpanWithNamedLineSpanAgainstOpposite(oppositeLine, position, side, lastLine, linesCollection);
}
示例3: resolveGridPositionAgainstOppositePosition
static GridSpan resolveGridPositionAgainstOppositePosition(const RenderStyle& gridContainerStyle, int oppositeLine, const GridPosition& position, GridPositionSide side, unsigned autoRepeatTracksCount)
{
if (position.isAuto()) {
if (isStartSide(side))
return GridSpan::untranslatedDefiniteGridSpan(oppositeLine - 1, oppositeLine);
return GridSpan::untranslatedDefiniteGridSpan(oppositeLine, oppositeLine + 1);
}
ASSERT(position.isSpan());
ASSERT(position.spanPosition() > 0);
if (!position.namedGridLine().isNull()) {
// span 2 'c' -> we need to find the appropriate grid line before / after our opposite position.
return resolveNamedGridLinePositionAgainstOppositePosition(gridContainerStyle, oppositeLine, position, side, autoRepeatTracksCount);
}
// 'span 1' is contained inside a single grid track regardless of the direction.
// That's why the CSS span value is one more than the offset we apply.
unsigned positionOffset = position.spanPosition();
if (isStartSide(side))
return GridSpan::untranslatedDefiniteGridSpan(oppositeLine - positionOffset, oppositeLine);
return GridSpan::untranslatedDefiniteGridSpan(oppositeLine, oppositeLine + positionOffset);
}
示例4: create
PassOwnPtr<GridSpan> GridResolvedPosition::resolveGridPositionAgainstOppositePosition(const RenderStyle& gridContainerStyle, const GridResolvedPosition& resolvedOppositePosition, const GridPosition& position, GridPositionSide side)
{
if (position.isAuto())
return GridSpan::create(resolvedOppositePosition, resolvedOppositePosition);
ASSERT(position.isSpan());
ASSERT(position.spanPosition() > 0);
if (!position.namedGridLine().isNull()) {
// span 2 'c' -> we need to find the appropriate grid line before / after our opposite position.
return resolveNamedGridLinePositionAgainstOppositePosition(gridContainerStyle, resolvedOppositePosition, position, side);
}
return GridSpan::createWithSpanAgainstOpposite(resolvedOppositePosition, position, side);
}
示例5: spanSizeForAutoPlacedItem
unsigned GridPositionsResolver::spanSizeForAutoPlacedItem(const RenderStyle& gridContainerStyle, const RenderBox& gridItem, GridTrackSizingDirection direction)
{
GridPosition initialPosition, finalPosition;
adjustGridPositionsFromStyle(gridContainerStyle, gridItem, direction, initialPosition, finalPosition);
// This method will only be used when both positions need to be resolved against the opposite one.
ASSERT(initialPosition.shouldBeResolvedAgainstOppositePosition() && finalPosition.shouldBeResolvedAgainstOppositePosition());
if (initialPosition.isAuto() && finalPosition.isAuto())
return 1;
GridPosition position = initialPosition.isSpan() ? initialPosition : finalPosition;
ASSERT(position.isSpan());
ASSERT(position.spanPosition());
return position.spanPosition();
}
示例6: resolveGridPositionAgainstOppositePosition
GridSpan GridResolvedPosition::resolveGridPositionAgainstOppositePosition(const ComputedStyle& gridContainerStyle, const GridResolvedPosition& resolvedOppositePosition, const GridPosition& position, GridPositionSide side)
{
if (position.isAuto()) {
if ((side == ColumnStartSide || side == RowStartSide) && resolvedOppositePosition.toInt())
return GridSpan::definiteGridSpan(resolvedOppositePosition.prev(), resolvedOppositePosition);
return GridSpan::definiteGridSpan(resolvedOppositePosition, resolvedOppositePosition.next());
}
ASSERT(position.isSpan());
ASSERT(position.spanPosition() > 0);
if (!position.namedGridLine().isNull()) {
// span 2 'c' -> we need to find the appropriate grid line before / after our opposite position.
return resolveNamedGridLinePositionAgainstOppositePosition(gridContainerStyle, resolvedOppositePosition, position, side);
}
return GridSpan::definiteGridSpanWithSpanAgainstOpposite(resolvedOppositePosition, position, side);
}