本文整理汇总了C++中webcore::IntRect::unite方法的典型用法代码示例。如果您正苦于以下问题:C++ IntRect::unite方法的具体用法?C++ IntRect::unite怎么用?C++ IntRect::unite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::IntRect
的用法示例。
在下文中一共展示了IntRect::unite方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cursorRingBounds
WebCore::IntRect CachedNode::cursorRingBounds(const CachedFrame* frame) const
{
int partMax = mNavableRects;
ASSERT(partMax > 0);
WebCore::IntRect bounds = mCursorRing[0];
for (int partIndex = 1; partIndex < partMax; partIndex++)
bounds.unite(mCursorRing[partIndex]);
bounds.inflate(CURSOR_RING_HIT_TEST_RADIUS);
return mIsInLayer ? frame->adjustBounds(this, bounds) : bounds;
}
示例2: findFixedElementRect
void WebPageCompositorPrivate::findFixedElementRect(LayerCompositingThread* layer, WebCore::IntRect& fixedElementRect)
{
if ((layer->hasFixedContainer() || layer->isFixedPosition() || layer->hasFixedAncestorInDOMTree()) && layer->layerRenderer()) {
IntRect fixedRect = layer->layerRenderer()->toPixelViewportCoordinates(layer->boundingBox());
// FIXME: It's possible that the rects don't intersect now, but will be connected by a fixed rect found later.
// We need to handle it as well.
if (fixedElementRect.isEmpty() || fixedElementRect.intersects(fixedRect)) // Unite rects if they intersect each other.
fixedElementRect.unite(fixedRect);
else if (fixedRect.y() < fixedElementRect.y()) // Replace the fixedElementRect with fixedRect if fixedRect is above it (closer to top).
fixedElementRect = fixedRect;
}
const Vector<RefPtr<LayerCompositingThread> >& sublayers = layer->sublayers();
for (size_t i = 0; i < sublayers.size(); i++)
findFixedElementRect(sublayers[i].get(), fixedElementRect);
}