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


C++ setNeedsLayout函数代码示例

本文整理汇总了C++中setNeedsLayout函数的典型用法代码示例。如果您正苦于以下问题:C++ setNeedsLayout函数的具体用法?C++ setNeedsLayout怎么用?C++ setNeedsLayout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setNeedsLayout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: splitPosition

void RenderFrameSet::continueResizing(GridAxis& axis, int position)
{
    if (needsLayout())
        return;
    if (axis.m_splitBeingResized == noSplit)
        return;
    int currentSplitPosition = splitPosition(axis, axis.m_splitBeingResized);
    int delta = (position - currentSplitPosition) - axis.m_splitResizeOffset;
    if (delta == 0)
        return;
    axis.m_deltas[axis.m_splitBeingResized - 1] += delta;
    axis.m_deltas[axis.m_splitBeingResized] -= delta;
    setNeedsLayout(true);
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:14,代码来源:RenderFrameSet.cpp

示例2: repainter

void RenderPath::layout()
{
    // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root
    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout(), &m_absoluteBounds);
    
    calculateLocalTransform();

    setPath(static_cast<SVGStyledTransformableElement*>(element())->toPathData());

    m_absoluteBounds = absoluteClippedOverflowRect();

    repainter.repaintAfterLayout();

    setNeedsLayout(false);
}
开发者ID:marshall,项目名称:webkit_titanium,代码行数:15,代码来源:RenderPath.cpp

示例3: updateWidgetPosition

void RenderFrame::layout()
{
    FrameView* view = static_cast<FrameView*>(widget());
    RenderView* root = view ? view->frame()->contentRenderer() : 0;

    // Do not expand frames which has zero width or height
    if (!width() || !height() || !root) {
        updateWidgetPosition();
        if (view)
            view->layout();
        setNeedsLayout(false);
        return;
    }

    HTMLFrameElementBase* element = static_cast<HTMLFrameElementBase*>(node());
    if (element->scrollingMode() == ScrollbarAlwaysOff && !root->isFrameSet()) {
        setNeedsLayout(false);
        return;
    }

    // Update the dimensions to get the correct width and height
//SAMSUNG CHANGE >> P130502-1763
    updateWidgetPosition();
    if (root->preferredLogicalWidthsDirty())
        root->computePreferredLogicalWidths();

    // Expand the frame by setting frame height = content height
    setWidth(max(view->contentsWidth() + borderAndPaddingWidth(), width()));
    setHeight(max(view->contentsHeight() + borderAndPaddingHeight(), height()));

    // Update one more time
    updateWidgetPosition();
//SAMSUNG CHANGE << P130502-1763

    setNeedsLayout(false);
}
开发者ID:a33g-dev,项目名称:platform_samsung,代码行数:36,代码来源:RenderFrame.cpp

示例4: ASSERT

void RenderSVGContainer::layout()
{
    ASSERT(needsLayout());
    ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.

    calcViewport(); // Allow RenderSVGViewportContainer to update its viewport

    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() || selfWillPaint());
    calculateLocalTransform(); // Allow RenderSVGTransformableContainer to update its transform

    layoutChildren(this, selfNeedsLayout());
    repainter.repaintAfterLayout();

    setNeedsLayout(false);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:15,代码来源:RenderSVGContainer.cpp

示例5: ASSERT

void RenderContainer::layout()
{
    ASSERT(needsLayout());

    view()->pushLayoutState(this, IntSize(m_x, m_y));

    RenderObject* child = m_firstChild;
    while (child) {
        child->layoutIfNeeded();
        ASSERT(child->isRenderInline() || !child->needsLayout());
        child = child->nextSibling();
    }

    view()->popLayoutState();
    setNeedsLayout(false);
}
开发者ID:JonasZ95,项目名称:EAWebkit,代码行数:16,代码来源:RenderContainer.cpp

示例6: ASSERT

void RenderSVGHiddenContainer::layout()
{
    ASSERT(needsLayout());
 
    // Layout our kids to prevent a kid from being marked as needing layout
    // then never being asked to layout.
    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
        if (selfNeedsLayout())
            child->setNeedsLayout(true);
        
        child->layoutIfNeeded();
        ASSERT(!child->needsLayout());
    }
    
    setNeedsLayout(false);    
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:16,代码来源:RenderSVGHiddenContainer.cpp

示例7: ASSERT

void RenderReplaced::layout()
{
    ASSERT(needsLayout());

    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());

    setHeight(minimumReplacedHeight());

    calcWidth();
    calcHeight();
    adjustOverflowForBoxShadowAndReflect();

    repainter.repaintAfterLayout();

    setNeedsLayout(false);
}
开发者ID:tomagoyaky,项目名称:ComponentSuperAccessor,代码行数:16,代码来源:RenderReplaced.cpp

示例8: setHasCustomRegionStyle

void RenderNamedFlowFragment::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
    RenderRegion::styleDidChange(diff, oldStyle);

    // If the region is not attached to any thread, there is no need to check
    // whether the region has region styling since no content will be displayed
    // into the region.
    if (!m_flowThread) {
        setHasCustomRegionStyle(false);
        return;
    }

    checkRegionStyle();

    if (parent() && parent()->needsLayout())
        setNeedsLayout(MarkOnlyThis);
}
开发者ID:rajeshpillai,项目名称:webkit,代码行数:17,代码来源:RenderNamedFlowFragment.cpp

示例9: ASSERT

void RenderSVGRoot::layout()
{
    StackStats::LayoutCheckPoint layoutCheckPoint;
    ASSERT(needsLayout());

    m_resourcesNeedingToInvalidateClients.clear();

    // Arbitrary affine transforms are incompatible with LayoutState.
    LayoutStateDisabler layoutStateDisabler(view());

    bool needsLayout = selfNeedsLayout();
    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout);

    LayoutSize oldSize = size();
    updateLogicalWidth();
    updateLogicalHeight();
    buildLocalToBorderBoxTransform();

    SVGSVGElement* svg = toSVGSVGElement(node());
    ASSERT(svg);
    m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());
    SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this));

    if (!m_resourcesNeedingToInvalidateClients.isEmpty()) {
        // Invalidate resource clients, which may mark some nodes for layout.
        HashSet<RenderSVGResourceContainer*>::iterator end = m_resourcesNeedingToInvalidateClients.end();
        for (HashSet<RenderSVGResourceContainer*>::iterator it = m_resourcesNeedingToInvalidateClients.begin(); it != end; ++it)
            (*it)->removeAllClientsFromCache();

        m_isLayoutSizeChanged = false;
        SVGRenderSupport::layoutChildren(this, false);
    }

    // At this point LayoutRepainter already grabbed the old bounds,
    // recalculate them now so repaintAfterLayout() uses the new bounds.
    if (m_needsBoundariesOrTransformUpdate) {
        updateCachedBoundaries();
        m_needsBoundariesOrTransformUpdate = false;
    }

    updateLayerTransform();

    repainter.repaintAfterLayout();

    setNeedsLayout(false);
}
开发者ID:windyuuy,项目名称:opera,代码行数:46,代码来源:RenderSVGRoot.cpp

示例10: ASSERT

void RenderReplaced::layout()
{
    ASSERT(needsLayout());
    
    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
    
    setHeight(minimumReplacedHeight());

    updateLogicalWidth();
    updateLogicalHeight();

    m_overflow.clear();
    addVisualEffectOverflow();
    updateLayerTransform();
    
    repainter.repaintAfterLayout();
    setNeedsLayout(false);
}
开发者ID:pial003,项目名称:RespImg-WebCore,代码行数:18,代码来源:RenderReplaced.cpp

示例11: ASSERT

void RenderSVGHiddenContainer::layout()
{
    ASSERT(needsLayout());
 
    // Layout our kids to prevent a kid from being marked as needing layout
    // then never being asked to layout.
    RenderObject* child = firstChild();
    while (child) {
        if (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues())
            child->setNeedsLayout(true);
        
        child->layoutIfNeeded();
        ASSERT(!child->needsLayout());
        child = child->nextSibling();
    }
    
    setNeedsLayout(false);    
}
开发者ID:pk-codebox-evo,项目名称:remixos-usb-tool,代码行数:18,代码来源:RenderSVGHiddenContainer.cpp

示例12: ASSERT

void RenderSVGText::layout()
{
    ASSERT(needsLayout());
    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());

    // Best guess for a relative starting point
    SVGTextElement* text = static_cast<SVGTextElement*>(node());
    int xOffset = (int)(text->x()->getFirst().value(text));
    int yOffset = (int)(text->y()->getFirst().value(text));
    setLocation(xOffset, yOffset);

    m_localTransform = text->animatedLocalTransform();

    RenderBlock::layout();

    repainter.repaintAfterLayout();
    setNeedsLayout(false);
}
开发者ID:ShouqingZhang,项目名称:webkitdriver,代码行数:18,代码来源:RenderSVGText.cpp

示例13: ASSERT

void RenderFrameSet::layout()
{
    ASSERT(needsLayout());

    bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout();
    IntRect oldBounds;
    if (doFullRepaint)
        oldBounds = absoluteClippedOverflowRect();

    if (!parent()->isFrameSet() && !document()->printing()) {
        setWidth(view()->viewWidth());
        setHeight(view()->viewHeight());
    }

    size_t cols = frameSet()->totalCols();
    size_t rows = frameSet()->totalRows();

    if (m_rows.m_sizes.size() != rows || m_cols.m_sizes.size() != cols) {
        m_rows.resize(rows);
        m_cols.resize(cols);
    }

    int borderThickness = frameSet()->border();
    layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness);
    layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness);

    if (flattenFrameSet())
        positionFramesWithFlattening();
    else
        positionFrames();

    RenderBox::layout();

    computeEdgeInfo();

    if (doFullRepaint) {
        view()->repaintViewRectangle(oldBounds);
        IntRect newBounds = absoluteClippedOverflowRect();
        if (newBounds != oldBounds)
            view()->repaintViewRectangle(newBounds);
    }

    setNeedsLayout(false);
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:44,代码来源:RenderFrameSet.cpp

示例14: viewWidth

void RenderView::layout()
{
    layoutCounter.startCounting();
    if (printing())
        m_minPrefWidth = m_maxPrefWidth = m_width;

    // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
    bool relayoutChildren = !printing() && (!m_frameView || m_width != viewWidth() || m_height != viewHeight());
    if (relayoutChildren) {
        setChildNeedsLayout(true, false);
        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
            if (child->style()->height().isPercent() || child->style()->minHeight().isPercent() || child->style()->maxHeight().isPercent())
                child->setChildNeedsLayout(true, false);
        }
    }

    ASSERT(!m_layoutState);
    LayoutState state;
    IntRect viewRectangle = viewRect();
    // An empty rect is not valid viewRect.
    state.m_clipped = !viewRectangle.isEmpty();

    if (state.m_clipped) {
        state.m_clipRect = IntRect(IntPoint(0, 0), viewRectangle.size());
        state.m_offset = IntSize(viewRectangle.x(), viewRectangle.y());
    }
    m_layoutState = &state;

    if (needsLayout())
        RenderBlock::layout();

    // Ensure that docWidth() >= width() and docHeight() >= height().
    setOverflowWidth(m_width);
    setOverflowHeight(m_height);

    setOverflowWidth(docWidth());
    setOverflowHeight(docHeight());

    ASSERT(m_layoutStateDisableCount == 0);
    ASSERT(m_layoutState == &state);
    m_layoutState = 0;
    setNeedsLayout(false);
    layoutCounter.stopCounting();
}
开发者ID:acss,项目名称:owb-mirror,代码行数:44,代码来源:RenderView.cpp

示例15: ASSERT

void RenderSVGContainer::layout()
{
    ASSERT(needsLayout());

    calcViewport();

    // Arbitrary affine transforms are incompatible with LayoutState.
    view()->disableLayoutState();

    IntRect oldBounds;
    IntRect oldOutlineBox;
    bool checkForRepaint = checkForRepaintDuringLayout();
    if (selfNeedsLayout() && checkForRepaint) {
        oldBounds = m_absoluteBounds;
        oldOutlineBox = absoluteOutlineBox();
    }

    RenderObject* child = firstChild();
    while (child) {
        if (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues())
            child->setNeedsLayout(true);

        child->layoutIfNeeded();
        ASSERT(!child->needsLayout());
        child = child->nextSibling();
    }

    calcWidth();
    calcHeight();

    m_absoluteBounds = absoluteClippedOverflowRect();
    if (!parent()->isSVGContainer()) {
        SVGSVGElement* svg = static_cast<SVGSVGElement*>(element());
        m_width = static_cast<int>(static_cast<float>(m_width) * svg->currentScale());
        m_height = static_cast<int>(static_cast<float>(m_height) * svg->currentScale());
    }

    if (selfNeedsLayout() && checkForRepaint)
        repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);

    view()->enableLayoutState();
    setNeedsLayout(false);
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:43,代码来源:RenderSVGContainer.cpp


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