本文整理汇总了C++中FillLayer::repeatY方法的典型用法代码示例。如果您正苦于以下问题:C++ FillLayer::repeatY方法的具体用法?C++ FillLayer::repeatY怎么用?C++ FillLayer::repeatY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FillLayer
的用法示例。
在下文中一共展示了FillLayer::repeatY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculate
//.........这里部分代码省略.........
paintRect.size() - LayoutSize(left + right, top + bottom);
}
} else {
setHasNonLocalGeometry();
LayoutRect viewportRect = obj.viewRect();
if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) {
viewportRect.setLocation(LayoutPoint());
} else {
if (FrameView* frameView = obj.view()->frameView())
viewportRect.setLocation(IntPoint(frameView->scrollOffsetInt()));
// Compensate the translations created by ScrollRecorders.
// TODO(trchen): Fix this for SP phase 2. crbug.com/529963.
viewportRect.moveBy(
accumulatedScrollOffsetForFixedBackground(obj, paintContainer));
}
if (paintContainer)
viewportRect.moveBy(
LayoutPoint(-paintContainer->localToAbsolute(FloatPoint())));
setDestRect(viewportRect);
positioningAreaSize = destRect().size();
}
LayoutSize fillTileSize(
calculateFillTileSize(positioningBox, fillLayer, positioningAreaSize));
// It's necessary to apply the heuristic here prior to any further
// calculations to avoid incorrectly using sub-pixel values that won't be
// present in the painted tile.
setTileSize(applySubPixelHeuristicToImageSize(fillTileSize, m_destRect));
EFillRepeat backgroundRepeatX = fillLayer.repeatX();
EFillRepeat backgroundRepeatY = fillLayer.repeatY();
LayoutUnit unsnappedAvailableWidth =
positioningAreaSize.width() - fillTileSize.width();
LayoutUnit unsnappedAvailableHeight =
positioningAreaSize.height() - fillTileSize.height();
positioningAreaSize =
LayoutSize(snapSizeToPixel(positioningAreaSize.width(), m_destRect.x()),
snapSizeToPixel(positioningAreaSize.height(), m_destRect.y()));
LayoutUnit availableWidth = positioningAreaSize.width() - tileSize().width();
LayoutUnit availableHeight =
positioningAreaSize.height() - tileSize().height();
LayoutUnit computedXPosition =
roundedMinimumValueForLength(fillLayer.xPosition(), availableWidth);
if (backgroundRepeatX == RoundFill &&
positioningAreaSize.width() > LayoutUnit() &&
fillTileSize.width() > LayoutUnit()) {
int nrTiles = std::max(
1, roundToInt(positioningAreaSize.width() / fillTileSize.width()));
LayoutUnit roundedWidth = positioningAreaSize.width() / nrTiles;
// Maintain aspect ratio if background-size: auto is set
if (fillLayer.size().size.height().isAuto() &&
backgroundRepeatY != RoundFill) {
fillTileSize.setHeight(fillTileSize.height() * roundedWidth /
fillTileSize.width());
}
fillTileSize.setWidth(roundedWidth);
setTileSize(applySubPixelHeuristicToImageSize(fillTileSize, m_destRect));
setPhaseX(tileSize().width()
? LayoutUnit(roundf(
tileSize().width() -