本文整理汇总了C++中LayoutRect::expand方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutRect::expand方法的具体用法?C++ LayoutRect::expand怎么用?C++ LayoutRect::expand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutRect
的用法示例。
在下文中一共展示了LayoutRect::expand方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintMask
void RenderFieldset::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
LayoutRect paintRect = LayoutRect(paintOffset, size());
RenderBox* legend = findLegend();
if (!legend)
return RenderBlockFlow::paintMask(paintInfo, paintOffset);
// FIXME: We need to work with "rl" and "bt" block flow directions. In those
// cases the legend is embedded in the right and bottom borders respectively.
// https://bugs.webkit.org/show_bug.cgi?id=47236
if (style().isHorizontalWritingMode()) {
LayoutUnit yOff = (legend->y() > 0) ? LayoutUnit() : (legend->height() - borderTop()) / 2;
paintRect.expand(0, -yOff);
paintRect.move(0, yOff);
} else {
LayoutUnit xOff = (legend->x() > 0) ? LayoutUnit() : (legend->width() - borderLeft()) / 2;
paintRect.expand(-xOff, 0);
paintRect.move(xOff, 0);
}
paintMaskImages(paintInfo, paintRect);
}
示例2: paintMask
void FieldsetPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (m_layoutFieldset.style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
LayoutRect paintRect = LayoutRect(paintOffset, m_layoutFieldset.size());
LayoutBox* legend = m_layoutFieldset.findInFlowLegend();
if (!legend)
return BoxPainter(m_layoutFieldset).paintMask(paintInfo, paintOffset);
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, m_layoutFieldset, paintInfo.phase, paintOffset))
return;
// FIXME: We need to work with "rl" and "bt" block flow directions. In those
// cases the legend is embedded in the right and bottom borders respectively.
// https://bugs.webkit.org/show_bug.cgi?id=47236
if (m_layoutFieldset.style()->isHorizontalWritingMode()) {
LayoutUnit yOff = (legend->location().y() > LayoutUnit()) ? LayoutUnit() : (legend->size().height() - m_layoutFieldset.borderTop()) / 2;
paintRect.expand(LayoutUnit(), -yOff);
paintRect.move(LayoutUnit(), yOff);
} else {
LayoutUnit xOff = (legend->location().x() > LayoutUnit()) ? LayoutUnit() : (legend->size().width() - m_layoutFieldset.borderLeft()) / 2;
paintRect.expand(-xOff, LayoutUnit());
paintRect.move(xOff, LayoutUnit());
}
LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutFieldset, paintInfo.phase, paintRect, paintOffset);
BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect);
}
示例3: computeSourceImageRectForDirtyRect
LayoutRect FilterEffectRenderer::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect)
{
// The result of this function is the area in the "filterBoxRect" that needs to be repainted, so that we fully cover the "dirtyRect".
LayoutRect rectForRepaint = dirtyRect;
if (hasFilterThatMovesPixels()) {
// Note that the outsets are reversed here because we are going backwards -> we have the dirty rect and
// need to find out what is the rectangle that might influence the result inside that dirty rect.
rectForRepaint.move(-m_outsets.right(), -m_outsets.bottom());
rectForRepaint.expand(m_outsets.left() + m_outsets.right(), m_outsets.top() + m_outsets.bottom());
}
rectForRepaint.intersect(filterBoxRect);
return rectForRepaint;
}
示例4: computeSourceImageRectForDirtyRect
LayoutRect FilterEffectRenderer::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect)
{
#if ENABLE(CSS_SHADERS)
if (hasCustomShaderFilter()) {
// When we have at least a custom shader in the chain, we need to compute the whole source image, because the shader can
// reference any pixel and we cannot control that.
return filterBoxRect;
}
#endif
// The result of this function is the area in the "filterBoxRect" that needs to be repainted, so that we fully cover the "dirtyRect".
LayoutRect rectForRepaint = dirtyRect;
if (hasFilterThatMovesPixels()) {
// Note that the outsets are reversed here because we are going backwards -> we have the dirty rect and
// need to find out what is the rectangle that might influence the result inside that dirty rect.
rectForRepaint.move(-m_rightOutset, -m_bottomOutset);
rectForRepaint.expand(m_leftOutset + m_rightOutset, m_topOutset + m_bottomOutset);
}
rectForRepaint.intersect(filterBoxRect);
return rectForRepaint;
}
示例5: flowThreadPortionRectForClipping
LayoutRect RenderNamedFlowFragment::flowThreadPortionRectForClipping(bool isFirstRegionInRange, bool isLastRegionInRange) const
{
// Elements flowed into a region should not be painted past the region's content box
// if they continue to flow into another region in that direction.
// If they do not continue into another region in that direction, they should be
// painted all the way to the region's border box.
// Regions with overflow:hidden will apply clip at the border box, not the content box.
LayoutRect clippingRect = flowThreadPortionRect();
RenderBlockFlow& container = fragmentContainer();
if (container.style().hasPadding()) {
if (isFirstRegionInRange) {
if (flowThread()->isHorizontalWritingMode()) {
clippingRect.move(0, -container.paddingBefore());
clippingRect.expand(0, container.paddingBefore());
} else {
clippingRect.move(-container.paddingBefore(), 0);
clippingRect.expand(container.paddingBefore(), 0);
}
}
if (isLastRegionInRange) {
if (flowThread()->isHorizontalWritingMode())
clippingRect.expand(0, container.paddingAfter());
else
clippingRect.expand(container.paddingAfter(), 0);
}
if (flowThread()->isHorizontalWritingMode()) {
clippingRect.move(-container.paddingStart(), 0);
clippingRect.expand(container.paddingStart() + container.paddingEnd(), 0);
} else {
clippingRect.move(0, -container.paddingStart());
clippingRect.expand(0, container.paddingStart() + container.paddingEnd());
}
}
return clippingRect;
}