本文整理汇总了C++中LayoutRect::shiftMaxXEdgeTo方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutRect::shiftMaxXEdgeTo方法的具体用法?C++ LayoutRect::shiftMaxXEdgeTo怎么用?C++ LayoutRect::shiftMaxXEdgeTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutRect
的用法示例。
在下文中一共展示了LayoutRect::shiftMaxXEdgeTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: flowThreadPortionOverflowRectAt
LayoutRect MultiColumnFragmentainerGroup::flowThreadPortionOverflowRectAt(
unsigned columnIndex) const {
// This function determines the portion of the flow thread that paints for the
// column. Along the inline axis, columns are unclipped at outside edges
// (i.e., the first and last column in the set), and they clip to half the
// column gap along interior edges.
//
// In the block direction, we will not clip overflow out of the top of the
// first column, or out of the bottom of the last column. This applies only to
// the true first column and last column across all column sets.
//
// FIXME: Eventually we will know overflow on a per-column basis, but we can't
// do this until we have a painting mode that understands not to paint
// contents from a previous column in the overflow area of a following column.
bool isFirstColumnInRow = !columnIndex;
bool isLastColumnInRow = columnIndex == actualColumnCount() - 1;
bool isLTR = m_columnSet.style()->isLeftToRightDirection();
bool isLeftmostColumn = isLTR ? isFirstColumnInRow : isLastColumnInRow;
bool isRightmostColumn = isLTR ? isLastColumnInRow : isFirstColumnInRow;
LayoutRect portionRect = flowThreadPortionRectAt(columnIndex);
bool isFirstColumnInMulticolContainer =
isFirstColumnInRow && this == &m_columnSet.firstFragmentainerGroup() &&
!m_columnSet.previousSiblingMultiColumnSet();
bool isLastColumnInMulticolContainer =
isLastColumnInRow && this == &m_columnSet.lastFragmentainerGroup() &&
!m_columnSet.nextSiblingMultiColumnSet();
// Calculate the overflow rectangle, based on the flow thread's, clipped at
// column logical top/bottom unless it's the first/last column.
LayoutRect overflowRect = m_columnSet.overflowRectForFlowThreadPortion(
portionRect, isFirstColumnInMulticolContainer,
isLastColumnInMulticolContainer);
// Avoid overflowing into neighboring columns, by clipping in the middle of
// adjacent column gaps. Also make sure that we avoid rounding errors.
LayoutUnit columnGap = m_columnSet.columnGap();
if (m_columnSet.isHorizontalWritingMode()) {
if (!isLeftmostColumn)
overflowRect.shiftXEdgeTo(portionRect.x() - columnGap / 2);
if (!isRightmostColumn)
overflowRect.shiftMaxXEdgeTo(portionRect.maxX() + columnGap -
columnGap / 2);
} else {
if (!isLeftmostColumn)
overflowRect.shiftYEdgeTo(portionRect.y() - columnGap / 2);
if (!isRightmostColumn)
overflowRect.shiftMaxYEdgeTo(portionRect.maxY() + columnGap -
columnGap / 2);
}
return overflowRect;
}
示例2: paddedLayoutOverflowRect
LayoutRect RootInlineBox::paddedLayoutOverflowRect(LayoutUnit endPadding) const
{
LayoutRect lineLayoutOverflow = layoutOverflowRect(lineTop(), lineBottom());
if (!endPadding)
return lineLayoutOverflow;
// FIXME: Audit whether to use pixel snapped values when not using integers for layout: https://bugs.webkit.org/show_bug.cgi?id=63656
if (isHorizontal()) {
if (isLeftToRightDirection())
lineLayoutOverflow.shiftMaxXEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxX(), pixelSnappedLogicalRight() + endPadding));
else
lineLayoutOverflow.shiftXEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.x(), pixelSnappedLogicalLeft() - endPadding));
} else {
if (isLeftToRightDirection())
lineLayoutOverflow.shiftMaxYEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxY(), pixelSnappedLogicalRight() + endPadding));
else
lineLayoutOverflow.shiftYEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.y(), pixelSnappedLogicalLeft() - endPadding));
}
return lineLayoutOverflow;
}
示例3: flowThreadPortionOverflowRect
LayoutRect RenderMultiColumnSet::flowThreadPortionOverflowRect(const LayoutRect& portionRect, unsigned index, unsigned colCount, LayoutUnit colGap)
{
// This function determines the portion of the flow thread that paints for the column. Along the inline axis, columns are
// unclipped at outside edges (i.e., the first and last column in the set), and they clip to half the column
// gap along interior edges.
//
// In the block direction, we will not clip overflow out of the top of the first column, or out of the bottom of
// the last column. This applies only to the true first column and last column across all column sets.
//
// FIXME: Eventually we will know overflow on a per-column basis, but we can't do this until we have a painting
// mode that understands not to paint contents from a previous column in the overflow area of a following column.
// This problem applies to regions and pages as well and is not unique to columns.
RenderBlockFlow* parentFlow = toRenderBlockFlow(parent());
bool progressionReversed = parentFlow->multiColumnFlowThread()->progressionIsReversed();
bool isFirstColumn = !index;
bool isLastColumn = index == colCount - 1;
bool isLeftmostColumn = style().isLeftToRightDirection() ^ progressionReversed ? isFirstColumn : isLastColumn;
bool isRightmostColumn = style().isLeftToRightDirection() ^ progressionReversed ? isLastColumn : isFirstColumn;
// Calculate the overflow rectangle, based on the flow thread's, clipped at column logical
// top/bottom unless it's the first/last column.
LayoutRect overflowRect = overflowRectForFlowThreadPortion(portionRect, isFirstColumn && isFirstRegion(), isLastColumn && isLastRegion(), VisualOverflow);
// Avoid overflowing into neighboring columns, by clipping in the middle of adjacent column
// gaps. Also make sure that we avoid rounding errors.
if (isHorizontalWritingMode()) {
if (!isLeftmostColumn)
overflowRect.shiftXEdgeTo(portionRect.x() - colGap / 2);
if (!isRightmostColumn)
overflowRect.shiftMaxXEdgeTo(portionRect.maxX() + colGap - colGap / 2);
} else {
if (!isLeftmostColumn)
overflowRect.shiftYEdgeTo(portionRect.y() - colGap / 2);
if (!isRightmostColumn)
overflowRect.shiftMaxYEdgeTo(portionRect.maxY() + colGap - colGap / 2);
}
return overflowRect;
}