• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LayoutUnit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ASSERT

void LayoutTextControl::computePreferredLogicalWidths() {
  ASSERT(preferredLogicalWidthsDirty());

  m_minPreferredLogicalWidth = LayoutUnit();
  m_maxPreferredLogicalWidth = LayoutUnit();
  const ComputedStyle& styleToUse = styleRef();

  if (styleToUse.logicalWidth().isFixed() &&
      styleToUse.logicalWidth().value() >= 0)
    m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth =
        adjustContentBoxLogicalWidthForBoxSizing(
            styleToUse.logicalWidth().value());
  else
    computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth,
                                  m_maxPreferredLogicalWidth);

  if (styleToUse.logicalMinWidth().isFixed() &&
      styleToUse.logicalMinWidth().value() > 0) {
    m_maxPreferredLogicalWidth = std::max(
        m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                        styleToUse.logicalMinWidth().value()));
    m_minPreferredLogicalWidth = std::max(
        m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                        styleToUse.logicalMinWidth().value()));
  }

  if (styleToUse.logicalMaxWidth().isFixed()) {
    m_maxPreferredLogicalWidth = std::min(
        m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                        styleToUse.logicalMaxWidth().value()));
    m_minPreferredLogicalWidth = std::min(
        m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                        styleToUse.logicalMaxWidth().value()));
  }

  LayoutUnit toAdd = borderAndPaddingLogicalWidth();

  m_minPreferredLogicalWidth += toAdd;
  m_maxPreferredLogicalWidth += toAdd;

  clearPreferredLogicalWidthsDirty();
}
开发者ID:ollie314,项目名称:chromium,代码行数:42,代码来源:LayoutTextControl.cpp


示例2: TEST_F

TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowHidden) {
  setBodyInnerHTML(
      "<div id='container' style='writing-mode: vertical-rl; position: "
      "absolute; top: 111px; left: 222px;"
      "    border: solid red; border-width: 10px 20px 30px 40px;"
      "    overflow: hidden; width: 50px; height: 80px'>"
      "    <div id='target' style='box-shadow: 40px 20px black; width: 100px; "
      "height: 90px'></div>"
      "    <div style='width: 100px; height: 100px'></div>"
      "</div>");

  LayoutBlock* container =
      toLayoutBlock(getLayoutObjectByElementId("container"));
  EXPECT_EQ(LayoutUnit(), container->scrollTop());
  // The initial scroll offset is to the left-most because of flipped blocks
  // writing mode.
  // 150 = total_layout_overflow(100 + 100) - width(50)
  EXPECT_EQ(LayoutUnit(150), container->scrollLeft());
  container->setScrollTop(LayoutUnit(7));
  container->setScrollLeft(LayoutUnit(82));  // Scroll to the right by 8 pixels.
  document().view()->updateAllLifecyclePhases();

  LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
  LayoutRect targetVisualRect = target->localVisualRect();
  // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the
  // origin)
  // 140 = width(100) + box_shadow_offset_x(40)
  // 110 = height(90) + box_shadow_offset_y(20)
  EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetVisualRect);

  LayoutRect rect = targetVisualRect;
  target->flipForWritingMode(rect);
  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect));
  // This rect is in physical coordinates of target.
  EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect);

  rect = targetVisualRect;
  target->flipForWritingMode(rect);
  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect));
  // 58 = target_physical_x(100) + container_border_left(40) - scroll_left(58)
  EXPECT_EQ(LayoutRect(-10, 10, 140, 110), rect);
}
开发者ID:mirror,项目名称:chromium,代码行数:42,代码来源:VisualRectMappingTest.cpp


示例3: ASSERT

LayoutSize LayoutListMarker::imageBulletSize() const
{
    ASSERT(isImage());

    // FIXME: This is a somewhat arbitrary default width. Generated images for markers really won't
    // become particularly useful until we support the CSS3 marker pseudoclass to allow control over
    // the width and height of the marker box.
    LayoutUnit bulletWidth = style()->fontMetrics().ascent() / LayoutUnit(2);
    LayoutSize defaultBulletSize(bulletWidth, bulletWidth);
    return calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, DoNotScaleByEffectiveZoom);
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:11,代码来源:LayoutListMarker.cpp


示例4: getLayoutsList

LayoutUnit X11Helper::getCurrentLayout()
{
	QList<LayoutUnit> currentLayouts = getLayoutsList();
	unsigned int group = X11Helper::getGroup();
	if( group < (unsigned int)currentLayouts.size() )
		return currentLayouts[group];

	kWarning() << "Current group number" << group << "is outside of current layout list" <<
						getLayoutsListAsString(currentLayouts);
	return LayoutUnit();
}
开发者ID:ypid,项目名称:ktouch,代码行数:11,代码来源:x11_helper.cpp


示例5: LayoutRect

LayoutRect LayoutReplaced::localSelectionRect() const {
    if (getSelectionState() == SelectionNone)
        return LayoutRect();

    if (!inlineBoxWrapper()) {
        // We're a block-level replaced element.  Just return our own dimensions.
        return LayoutRect(LayoutPoint(), size());
    }

    RootInlineBox& root = inlineBoxWrapper()->root();
    LayoutUnit newLogicalTop =
        root.block().style()->isFlippedBlocksWritingMode()
        ? inlineBoxWrapper()->logicalBottom() - root.selectionBottom()
        : root.selectionTop() - inlineBoxWrapper()->logicalTop();
    if (root.block().style()->isHorizontalWritingMode())
        return LayoutRect(LayoutUnit(), newLogicalTop, size().width(),
                          root.selectionHeight());
    return LayoutRect(newLogicalTop, LayoutUnit(), root.selectionHeight(),
                      size().height());
}
开发者ID:mirror,项目名称:chromium,代码行数:20,代码来源:LayoutReplaced.cpp


示例6: availableWidthAtOffset

inline static LayoutUnit availableWidthAtOffset(
    LineLayoutBlockFlow block,
    const LayoutUnit& offset,
    IndentTextOrNot indentText,
    LayoutUnit& newLineLeft,
    LayoutUnit& newLineRight,
    const LayoutUnit& lineHeight = LayoutUnit()) {
  newLineLeft = block.logicalLeftOffsetForLine(offset, indentText, lineHeight);
  newLineRight =
      block.logicalRightOffsetForLine(offset, indentText, lineHeight);
  return (newLineRight - newLineLeft).clampNegativeToZero();
}
开发者ID:mirror,项目名称:chromium,代码行数:12,代码来源:LineWidth.cpp


示例7: LayoutUnit

void LayoutSVGForeignObject::computeLogicalHeight(
    LayoutUnit,
    LayoutUnit logicalTop,
    LogicalExtentComputedValues& computedValues) const {
  // FIXME: Investigate in size rounding issues
  // FIXME: Remove unnecessary rounding when layout is off ints:
  // webkit.org/b/63656
  // FIXME: Is this correct for vertical writing mode?
  computedValues.m_extent =
      LayoutUnit(static_cast<int>(roundf(m_viewport.height())));
  computedValues.m_position = logicalTop;
}
开发者ID:mirror,项目名称:chromium,代码行数:12,代码来源:LayoutSVGForeignObject.cpp


示例8: style

void LayoutListMarker::updateMargins()
{
    const FontMetrics& fontMetrics = style()->fontMetrics();

    LayoutUnit marginStart;
    LayoutUnit marginEnd;

    if (isInside()) {
        if (isImage()) {
            marginEnd = LayoutUnit(cMarkerPaddingPx);
        } else {
            switch (listStyleCategory()) {
            case ListStyleCategory::Symbol:
                marginStart = LayoutUnit(-1);
                marginEnd = fontMetrics.ascent() - minPreferredLogicalWidth() + 1;
                break;
            default:
                break;
            }
        }
    } else {
        if (style()->isLeftToRightDirection()) {
            if (isImage()) {
                marginStart = -minPreferredLogicalWidth() - cMarkerPaddingPx;
            } else {
                int offset = fontMetrics.ascent() * 2 / 3;
                switch (listStyleCategory()) {
                case ListStyleCategory::None:
                    break;
                case ListStyleCategory::Symbol:
                    marginStart = LayoutUnit(-offset - cMarkerPaddingPx - 1);
                    break;
                default:
                    marginStart = m_text.isEmpty() ? LayoutUnit() : -minPreferredLogicalWidth();
                }
            }
            marginEnd = -marginStart - minPreferredLogicalWidth();
        } else {
            if (isImage()) {
                marginEnd = LayoutUnit(cMarkerPaddingPx);
            } else {
                int offset = fontMetrics.ascent() * 2 / 3;
                switch (listStyleCategory()) {
                case ListStyleCategory::None:
                    break;
                case ListStyleCategory::Symbol:
                    marginEnd = offset + cMarkerPaddingPx + 1 - minPreferredLogicalWidth();
                    break;
                default:
                    marginEnd = LayoutUnit();
                }
            }
            marginStart = -marginEnd - minPreferredLogicalWidth();
        }

    }

    mutableStyleRef().setMarginStart(Length(marginStart, Fixed));
    mutableStyleRef().setMarginEnd(Length(marginEnd, Fixed));
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:60,代码来源:LayoutListMarker.cpp


示例9: lookupLocalized

void LayoutConfig::updateLayoutCommand()
{
    QString setxkbmap;
    QString layoutDisplayName;
    QListViewItem *sel = widget->listLayoutsDst->selectedItem();

    if(sel != NULL)
    {
        QString kbdLayout = sel->text(LAYOUT_COLUMN_MAP);
        QString variant = widget->comboVariant->currentText();
        if(variant == DEFAULT_VARIANT_NAME)
            variant = "";

        setxkbmap = "setxkbmap"; //-rules " + m_rule
        setxkbmap += " -model " + lookupLocalized(m_rules->models(), widget->comboModel->currentText()) + " -layout ";
        setxkbmap += kbdLayout;
        if(widget->chkLatin->isChecked())
            setxkbmap += ",us";

        /*	LayoutUnit layoutUnitKey = getLayoutUnitKey(sel);
            layoutDisplayName = m_kxkbConfig.getLayoutDisplayName( *m_kxkbConfig.m_layouts.find(layoutUnitKey) );*/
        layoutDisplayName = sel->text(LAYOUT_COLUMN_DISPLAY_NAME);
        if(layoutDisplayName.isEmpty())
        {
            int count = 0;
            QListViewItem *item = widget->listLayoutsDst->firstChild();
            while(item)
            {
                QString layout_ = item->text(LAYOUT_COLUMN_MAP);
                if(layout_ == kbdLayout)
                    ++count;
                item = item->nextSibling();
            }
            bool single = count < 2;
            layoutDisplayName = m_kxkbConfig.getDefaultDisplayName(LayoutUnit(kbdLayout, variant), single);
        }
        kdDebug() << "disp: '" << layoutDisplayName << "'" << endl;

        if(!variant.isEmpty())
        {
            setxkbmap += " -variant ";
            if(widget->chkLatin->isChecked())
                setxkbmap += ",";
            setxkbmap += variant;
        }
    }

    widget->editCmdLine->setText(setxkbmap);

    widget->editDisplayName->setEnabled(sel != NULL);
    widget->editDisplayName->setText(layoutDisplayName);
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:52,代码来源:kcmlayout.cpp


示例10: fixedSize

LayoutSize StyleGeneratedImage::imageSize(const LayoutObject* layoutObject, float multiplier) const
{
    if (m_fixedSize) {
        LayoutSize fixedSize(m_imageGeneratorValue->fixedSize(layoutObject));
        if (multiplier == 1.0f)
            return fixedSize;

        LayoutUnit width(fixedSize.width() * multiplier);
        LayoutUnit height(fixedSize.height() * multiplier);

        // Don't let images that have a width/height >= 1 shrink below 1 when zoomed.
        if (fixedSize.width() > LayoutUnit())
            width = max(LayoutUnit(1), width);

        if (fixedSize.height() > LayoutUnit())
            height = max(LayoutUnit(1), height);

        return LayoutSize(width, height);
    }

    return LayoutSize();
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:22,代码来源:StyleGeneratedImage.cpp


示例11: LayoutUnit

void TableLayoutAlgorithmFixed::applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const
{
    Length tableLogicalWidth = m_table->style()->logicalWidth();
    if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) {
        minWidth = maxWidth = LayoutUnit(max(minWidth, LayoutUnit(tableLogicalWidth.value() - m_table->bordersPaddingAndSpacingInRowDirection())).floor());
    }

    /*
        <table style="width:100%; background-color:red"><tr><td>
            <table style="background-color:blue"><tr><td>
                <table style="width:100%; background-color:green; table-layout:fixed"><tr><td>
                    Content
                </td></tr></table>
            </td></tr></table>
        </td></tr></table>
    */
    // In this example, the two inner tables should be as large as the outer table.
    // We can achieve this effect by making the maxwidth of fixed tables with percentage
    // widths be infinite.
    if (m_table->style()->logicalWidth().hasPercent() && maxWidth < tableMaxWidth)
        maxWidth = LayoutUnit(tableMaxWidth);
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:22,代码来源:TableLayoutAlgorithmFixed.cpp


示例12: ASSERT

LayoutRect LayoutListMarker::selectionRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const
{
    ASSERT(!needsLayout());

    if (getSelectionState() == SelectionNone || !inlineBoxWrapper())
        return LayoutRect();

    RootInlineBox& root = inlineBoxWrapper()->root();
    LayoutRect rect(LayoutUnit(), root.selectionTop() - location().y(), size().width(), root.selectionHeight());
    mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, nullptr);
    // FIXME: groupedMapping() leaks the squashing abstraction.
    if (paintInvalidationContainer->layer()->groupedMapping())
        PaintLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect);
    return rect;
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:15,代码来源:LayoutListMarker.cpp


示例13: ASSERT

LayoutSize LayoutListMarker::imageBulletSize() const {
  ASSERT(isImage());
  const SimpleFontData* fontData = style()->font().primaryFont();
  DCHECK(fontData);
  if (!fontData)
    return LayoutSize();

  // FIXME: This is a somewhat arbitrary default width. Generated images for
  // markers really won't become particularly useful until we support the CSS3
  // marker pseudoclass to allow control over the width and height of the
  // marker box.
  LayoutUnit bulletWidth = fontData->getFontMetrics().ascent() / LayoutUnit(2);
  return m_image->imageSize(*this, style()->effectiveZoom(),
                            LayoutSize(bulletWidth, bulletWidth));
}
开发者ID:mirror,项目名称:chromium,代码行数:15,代码来源:LayoutListMarker.cpp


示例14: ASSERT

LayoutUnit InlineTextBox::positionForOffset(int offset) const
{
    ASSERT(offset >= m_start);
    ASSERT(offset <= m_start + m_len);

    if (isLineBreak())
        return logicalLeft();

    LineLayoutText text = getLineLayoutItem();
    const ComputedStyle& styleToUse = text.styleRef(isFirstLineStyle());
    const Font& font = styleToUse.font();
    int from = !isLeftToRightDirection() ? offset - m_start : 0;
    int to = !isLeftToRightDirection() ? m_len : offset - m_start;
    // FIXME: Do we need to add rightBearing here?
    return LayoutUnit(font.selectionRectForText(constructTextRun(styleToUse, font), IntPoint(logicalLeft(), 0), 0, from, to).maxX());
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:16,代码来源:InlineTextBox.cpp


示例15: caretLayoutObject

// TODO(yoichio): |node| is FrameSelection::m_previousCaretNode and this is bad
// design. We should use only previous layoutObject or Rectangle to invalidate
// old caret.
void CaretBase::invalidateLocalCaretRect(Node* node, const LayoutRect& rect) {
    LayoutBlock* caretLayoutBlock = caretLayoutObject(node);
    if (!caretLayoutBlock)
        return;

    // FIXME: Need to over-paint 1 pixel to workaround some rounding problems.
    // https://bugs.webkit.org/show_bug.cgi?id=108283
    LayoutRect inflatedRect = rect;
    inflatedRect.inflate(LayoutUnit(1));

    // FIXME: We should not allow paint invalidation out of paint invalidation
    // state. crbug.com/457415
    DisablePaintInvalidationStateAsserts disabler;

    m_visualRect =
        node->layoutObject()->invalidatePaintRectangle(inflatedRect, this);
}
开发者ID:mirror,项目名称:chromium,代码行数:20,代码来源:CaretBase.cpp


示例16: multiColumnBlockFlow

LayoutUnit RenderMultiColumnSet::heightAdjustedForSetOffset(LayoutUnit height) const
{
    // Adjust for the top offset within the content box of the multicol container (containing
    // block), unless this is the first set. We know that the top offset for the first set will be
    // zero, but if the multicol container has non-zero top border or padding, the set's top offset
    // (initially being 0 and relative to the border box) will be negative until it has been laid
    // out. Had we used this bogus offset, we would calculate the wrong height, and risk performing
    // a wasted layout iteration. Of course all other sets (if any) have this problem in the first
    // layout pass too, but there's really nothing we can do there until the flow thread has been
    // laid out anyway.
    if (previousSiblingMultiColumnSet()) {
        RenderBlockFlow* multicolBlock = multiColumnBlockFlow();
        LayoutUnit contentLogicalTop = logicalTop() - multicolBlock->borderAndPaddingBefore();
        height -= contentLogicalTop;
    }
    return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would probably cause an infinite amount of columns to be created.
}
开发者ID:ewilligers,项目名称:blink,代码行数:17,代码来源:RenderMultiColumnSet.cpp


示例17: rubyText

void LayoutRubyRun::layout()
{
    LayoutBlockFlow::layout();

    LayoutRubyText* rt = rubyText();
    if (!rt)
        return;

    rt->setLogicalLeft(LayoutUnit());

    // Place the LayoutRubyText such that its bottom is flush with the lineTop of the first line of the LayoutRubyBase.
    LayoutUnit lastLineRubyTextBottom = rt->logicalHeight();
    LayoutUnit firstLineRubyTextTop;
    RootInlineBox* rootBox = rt->lastRootBox();
    if (rootBox) {
        // In order to align, we have to ignore negative leading.
        firstLineRubyTextTop = rt->firstRootBox()->logicalTopLayoutOverflow();
        lastLineRubyTextBottom = rootBox->logicalBottomLayoutOverflow();
    }

    if (style()->isFlippedLinesWritingMode() == (style()->rubyPosition() == RubyPositionAfter)) {
        LayoutUnit firstLineTop;
        if (LayoutRubyBase* rb = rubyBase()) {
            RootInlineBox* rootBox = rb->firstRootBox();
            if (rootBox)
                firstLineTop = rootBox->logicalTopLayoutOverflow();
            firstLineTop += rb->logicalTop();
        }

        rt->setLogicalTop(-lastLineRubyTextBottom + firstLineTop);
    } else {
        LayoutUnit lastLineBottom = logicalHeight();
        if (LayoutRubyBase* rb = rubyBase()) {
            RootInlineBox* rootBox = rb->lastRootBox();
            if (rootBox)
                lastLineBottom = rootBox->logicalBottomLayoutOverflow();
            lastLineBottom += rb->logicalTop();
        }

        rt->setLogicalTop(-firstLineRubyTextTop + lastLineBottom);
    }

    // Update our overflow to account for the new LayoutRubyText position.
    computeOverflow(clientLogicalBottom());
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:45,代码来源:LayoutRubyRun.cpp


示例18: ASSERT

void LayoutReplaced::computePreferredLogicalWidths() {
    ASSERT(preferredLogicalWidthsDirty());

    // We cannot resolve some logical width here (i.e. percent, fill-available or
    // fit-content) as the available logical width may not be set on our
    // containing block.
    const Length& logicalWidth = style()->logicalWidth();
    if (logicalWidth.isPercentOrCalc() || logicalWidth.isFillAvailable() ||
            logicalWidth.isFitContent())
        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth,
                                      m_maxPreferredLogicalWidth);
    else
        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth =
                                         computeReplacedLogicalWidth(ComputePreferred);

    const ComputedStyle& styleToUse = styleRef();
    if (styleToUse.logicalWidth().isPercentOrCalc() ||
            styleToUse.logicalMaxWidth().isPercentOrCalc())
        m_minPreferredLogicalWidth = LayoutUnit();

    if (styleToUse.logicalMinWidth().isFixed() &&
            styleToUse.logicalMinWidth().value() > 0) {
        m_maxPreferredLogicalWidth = std::max(
                                         m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                             styleToUse.logicalMinWidth().value()));
        m_minPreferredLogicalWidth = std::max(
                                         m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                             styleToUse.logicalMinWidth().value()));
    }

    if (styleToUse.logicalMaxWidth().isFixed()) {
        m_maxPreferredLogicalWidth = std::min(
                                         m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                             styleToUse.logicalMaxWidth().value()));
        m_minPreferredLogicalWidth = std::min(
                                         m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
                                             styleToUse.logicalMaxWidth().value()));
    }

    LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth();
    m_minPreferredLogicalWidth += borderAndPadding;
    m_maxPreferredLogicalWidth += borderAndPadding;

    clearPreferredLogicalWidthsDirty();
}
开发者ID:mirror,项目名称:chromium,代码行数:45,代码来源:LayoutReplaced.cpp


示例19: getLayoutsList

LayoutSet X11Helper::getCurrentLayouts()
{
	LayoutSet layoutSet;

	QList<LayoutUnit> currentLayouts = getLayoutsList();
	layoutSet.layouts = currentLayouts;

	unsigned int group = X11Helper::getGroup();
	if( group < (unsigned int)currentLayouts.size() ) {
		layoutSet.currentLayout = currentLayouts[group];
	}
	else {
		qCWarning(KCM_KEYBOARD) << "Current group number" << group << "is outside of current layout list" << getLayoutsListAsString(currentLayouts);
		layoutSet.currentLayout = LayoutUnit();
	}

	return layoutSet;
}
开发者ID:CerebrosuS,项目名称:plasma-desktop,代码行数:18,代码来源:x11_helper.cpp


示例20: virtualLogicalHeight

LayoutUnit InlineBox::logicalHeight() const
{
    if (hasVirtualLogicalHeight())
        return virtualLogicalHeight();

    if (lineLayoutItem().isText())
        return m_bitfields.isText() ? LayoutUnit(lineLayoutItem().style(isFirstLineStyle())->fontMetrics().height()) : LayoutUnit();
    if (lineLayoutItem().isBox() && parent())
        return isHorizontal() ? toLayoutBox(layoutObject()).size().height() : toLayoutBox(layoutObject()).size().width();

    ASSERT(isInlineFlowBox());
    LineLayoutBoxModel flowObject = boxModelObject();
    const FontMetrics& fontMetrics = lineLayoutItem().style(isFirstLineStyle())->fontMetrics();
    LayoutUnit result = fontMetrics.height();
    if (parent())
        result += flowObject.borderAndPaddingLogicalHeight();
    return result;
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:18,代码来源:InlineBox.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Lck_Lock函数代码示例发布时间:2022-05-30
下一篇:
C++ LayoutSize函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap