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


C++ InlineFlowBox::logicalHeight方法代码示例

本文整理汇总了C++中InlineFlowBox::logicalHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineFlowBox::logicalHeight方法的具体用法?C++ InlineFlowBox::logicalHeight怎么用?C++ InlineFlowBox::logicalHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InlineFlowBox的用法示例。


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

示例1: absoluteQuads

void LayoutSVGInline::absoluteQuads(Vector<FloatQuad>& quads) const {
  const LayoutSVGText* textRoot =
      LayoutSVGText::locateLayoutSVGTextAncestor(this);
  if (!textRoot)
    return;

  FloatRect textBoundingBox = textRoot->strokeBoundingBox();
  for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
    quads.append(
        localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x().toFloat(),
                                      textBoundingBox.y() + box->y().toFloat(),
                                      box->logicalWidth().toFloat(),
                                      box->logicalHeight().toFloat()),
                            false));
}
开发者ID:ollie314,项目名称:chromium,代码行数:15,代码来源:LayoutSVGInline.cpp

示例2: absoluteQuads

void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed)
{
    RenderObject* object = RenderSVGText::locateRenderSVGTextAncestor(this);
    if (!object)
        return;

    FloatRect textBoundingBox = object->strokeBoundingBox();
    for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
        quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->logicalWidth(), box->logicalHeight()), false, wasFixed));
}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:10,代码来源:RenderSVGInline.cpp

示例3: absoluteQuads

void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
{
    auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(*this);
    if (!textAncestor)
        return;

    FloatRect textBoundingBox = textAncestor->strokeBoundingBox();
    for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
        quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->logicalWidth(), box->logicalHeight()), UseTransforms, wasFixed));
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:10,代码来源:RenderSVGInline.cpp

示例4: layout

void SnapToLinesLayouter::layout()
{
    // http://dev.w3.org/html5/webvtt/#dfn-apply-webvtt-cue-settings
    // Step 13, "If cue's text track cue snap-to-lines flag is set".

    InlineFlowBox* firstLineBox = findFirstLineBox();
    if (!firstLineBox)
        return;

    // Steps 1-3 skipped.
    // 4. Horizontal: Let step be the height of the first line box in boxes.
    //    Vertical: Let step be the width of the first line box in boxes.
    LayoutUnit step = firstLineBox->logicalHeight();

    // 5. If step is zero, then jump to the step labeled done positioning below.
    if (!step)
        return;

    // Steps 6-11.
    LayoutUnit positionAdjustment = computeInitialPositionAdjustment(step);

    // 12. Move all boxes in boxes ...
    // Horizontal: ... down by the distance given by position
    // Vertical: ... right by the distance given by position
    moveBoxesBy(positionAdjustment);

    // 13. Remember the position of all the boxes in boxes as their specified
    // position.
    m_specifiedPosition = m_cueBox.location();

    // 14. Let best position be null. It will hold a position for boxes, much
    // like specified position in the previous step.
    // 15. Let best position score be null.

    // 16. Let switched be false.
    bool switched = false;

    // Step 17 skipped. (margin == 0; title area == video area)

    // 18. Step loop: If none of the boxes in boxes would overlap any of the
    // boxes in output, and all of the boxes in output are entirely within the
    // title area box, then jump to the step labeled done positioning below.
    while (isOutside() || isOverlapping()) {
        // 19. Let current position score be the percentage of the area of the
        // bounding box of the boxes in boxes that is outside the title area
        // box.
        // 20. If best position is null (i.e. this is the first run through
        // this loop, switched is still false, the boxes in boxes are at their
        // specified position, and best position score is still null), or if
        // current position score is a lower percentage than that in best
        // position score, then remember the position of all the boxes in boxes
        // as their best position, and set best position score to current
        // position score.
        if (!shouldSwitchDirection(firstLineBox, step)) {
            // 22. Horizontal: Move all the boxes in boxes down by the distance
            // given by step. (If step is negative, then this will actually
            // result in an upwards movement of the boxes in absolute terms.)
            // Vertical: Move all the boxes in boxes right by the distance
            // given by step. (If step is negative, then this will actually
            // result in a leftwards movement of the boxes in absolute terms.)
            moveBoxesBy(step);

            // 23. Jump back to the step labeled step loop.
            continue;
        }

        // 24. Switch direction: If switched is true, then move all the boxes in
        // boxes back to their best position, and jump to the step labeled done
        // positioning below.

        // 25. Otherwise, move all the boxes in boxes back to their specified
        // position as determined in the earlier step.
        m_cueBox.setLocation(m_specifiedPosition);

        // XX. If switched is true, jump to the step labeled done
        // positioning below.
        if (switched)
            break;

        // 26. Negate step.
        step = -step;

        // 27. Set switched to true.
        switched = true;

        // 28. Jump back to the step labeled step loop.
    }
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:88,代码来源:LayoutVTTCue.cpp


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