当前位置: 首页>>代码示例>>C++>>正文


C++ FloatRect::uniteEvenIfEmpty方法代码示例

本文整理汇总了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;
    }
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:28,代码来源:SVGRenderSupport.cpp

示例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);
}
开发者ID:kiranchandramohan,项目名称:webkit,代码行数:13,代码来源:SimpleLineLayoutFunctions.cpp

示例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);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:15,代码来源:SVGRenderSupport.cpp

示例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);
}
开发者ID:josedealcala,项目名称:webkit,代码行数:15,代码来源:SVGRenderSupport.cpp


注:本文中的FloatRect::uniteEvenIfEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。