本文整理汇总了C++中FloatRect::uniteEvenIfEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatRect::uniteEvenIfEmpty方法的具体用法?C++ FloatRect::uniteEvenIfEmpty怎么用?C++ FloatRect::uniteEvenIfEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatRect
的用法示例。
在下文中一共展示了FloatRect::uniteEvenIfEmpty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeContainerBoundingBoxes
void SVGRenderSupport::computeContainerBoundingBoxes(const RenderObject* container, FloatRect& objectBoundingBox, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox)
{
bool isFirstChild = true;
for (RenderObject* current = container->firstChild(); current; current = current->nextSibling()) {
if (current->isSVGHiddenContainer())
continue;
const AffineTransform& transform = current->localToParentTransform();
if (transform.isIdentity()) {
if (isFirstChild)
objectBoundingBox = current->objectBoundingBox();
else
objectBoundingBox.uniteEvenIfEmpty(current->objectBoundingBox());
strokeBoundingBox.unite(current->strokeBoundingBox());
repaintBoundingBox.unite(current->repaintRectInLocalCoordinates());
} else {
if (isFirstChild)
objectBoundingBox = transform.mapRect(current->objectBoundingBox());
else
objectBoundingBox.uniteEvenIfEmpty(transform.mapRect(current->objectBoundingBox()));
strokeBoundingBox.unite(transform.mapRect(current->strokeBoundingBox()));
repaintBoundingBox.unite(transform.mapRect(current->repaintRectInLocalCoordinates()));
}
isFirstChild = false;
}
}
示例2: computeBoundingBox
IntRect computeBoundingBox(const RenderObject& renderer, const Layout& layout)
{
auto resolver = runResolver(downcast<RenderBlockFlow>(*renderer.parent()), layout);
FloatRect boundingBoxRect;
for (auto run : resolver.rangeForRenderer(renderer)) {
FloatRect rect = run.rect();
if (boundingBoxRect == FloatRect())
boundingBoxRect = rect;
else
boundingBoxRect.uniteEvenIfEmpty(rect);
}
return enclosingIntRect(boundingBoxRect);
}
示例3: updateObjectBoundingBox
// Update a bounding box taking into account the validity of the other bounding box.
inline void SVGRenderSupport::updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBox)
{
bool otherValid = other->isSVGContainer() ? toRenderSVGContainer(other)->isObjectBoundingBoxValid() : true;
if (!otherValid)
return;
if (!objectBoundingBoxValid) {
objectBoundingBox = otherBoundingBox;
objectBoundingBoxValid = true;
return;
}
objectBoundingBox.uniteEvenIfEmpty(otherBoundingBox);
}
示例4: updateObjectBoundingBox
// Update a bounding box taking into account the validity of the other bounding box.
static inline void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBox)
{
bool otherValid = is<RenderSVGContainer>(*other) ? downcast<RenderSVGContainer>(*other).isObjectBoundingBoxValid() : true;
if (!otherValid)
return;
if (!objectBoundingBoxValid) {
objectBoundingBox = otherBoundingBox;
objectBoundingBoxValid = true;
return;
}
objectBoundingBox.uniteEvenIfEmpty(otherBoundingBox);
}