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


C++ LengthBox::right方法代码示例

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


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

示例1: mapNinePieceImageSlice

void CSSToStyleMap::mapNinePieceImageSlice(CSSValue& value, NinePieceImage& image)
{
    if (!is<CSSBorderImageSliceValue>(value))
        return;

    // Retrieve the border image value.
    auto& borderImageSlice = downcast<CSSBorderImageSliceValue>(value);

    // Set up a length box to represent our image slices.
    LengthBox box;
    Quad* slices = borderImageSlice.slices();
    if (slices->top()->isPercentage())
        box.top() = Length(slices->top()->getDoubleValue(), Percent);
    else
        box.top() = Length(slices->top()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
    if (slices->bottom()->isPercentage())
        box.bottom() = Length(slices->bottom()->getDoubleValue(), Percent);
    else
        box.bottom() = Length((int)slices->bottom()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
    if (slices->left()->isPercentage())
        box.left() = Length(slices->left()->getDoubleValue(), Percent);
    else
        box.left() = Length(slices->left()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
    if (slices->right()->isPercentage())
        box.right() = Length(slices->right()->getDoubleValue(), Percent);
    else
        box.right() = Length(slices->right()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
    image.setImageSlices(box);

    // Set our fill mode.
    image.setFill(borderImageSlice.m_fill);
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:32,代码来源:CSSToStyleMap.cpp

示例2: ClipAutos

 explicit ClipAutos(const LengthBox& clip)
     : isAuto(false)
     , isTopAuto(clip.top().isAuto())
     , isRightAuto(clip.right().isAuto())
     , isBottomAuto(clip.bottom().isAuto())
     , isLeftAuto(clip.left().isAuto())
 { }
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:7,代码来源:CSSClipInterpolationType.cpp

示例3: create

inline static PassRefPtr<AnimatableValue> createFromLengthBox(const LengthBox lengthBox, const RenderStyle* style)
{
    return AnimatableLengthBox::create(
               createFromLength(lengthBox.left(), style),
               createFromLength(lengthBox.right(), style),
               createFromLength(lengthBox.top(), style),
               createFromLength(lengthBox.bottom(), style));
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:8,代码来源:CSSAnimatableValueFactory.cpp

示例4: computeSlices

LayoutBoxExtent NinePieceImage::computeSlices(const LayoutSize& size, const LengthBox& lengths, const FloatBoxExtent& widths, const LayoutBoxExtent& slices)
{
    LayoutUnit top    = computeSlice(lengths.top(),    widths.top(),    slices.top(),    size.height());
    LayoutUnit right  = computeSlice(lengths.right(),  widths.right(),  slices.right(),  size.width());
    LayoutUnit bottom = computeSlice(lengths.bottom(), widths.bottom(), slices.bottom(), size.height());
    LayoutUnit left   = computeSlice(lengths.left(),   widths.left(),   slices.left(),   size.width());
    return LayoutBoxExtent(top, right, bottom, left);
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:8,代码来源:NinePieceImage.cpp

示例5: create

inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthBox(const LengthBox& lengthBox, const ComputedStyle& style)
{
    return AnimatableLengthBox::create(
        createFromLength(lengthBox.left(), style),
        createFromLength(lengthBox.right(), style),
        createFromLength(lengthBox.top(), style),
        createFromLength(lengthBox.bottom(), style));
}
开发者ID:joone,项目名称:blink-crosswalk,代码行数:8,代码来源:CSSAnimatableValueFactory.cpp

示例6: createClipValue

static InterpolationValue createClipValue(const LengthBox& clip, double zoom)
{
    OwnPtr<InterpolableList> list = InterpolableList::create(ClipComponentIndexCount);
    list->set(ClipTop, convertClipComponent(clip.top(), zoom));
    list->set(ClipRight, convertClipComponent(clip.right(), zoom));
    list->set(ClipBottom, convertClipComponent(clip.bottom(), zoom));
    list->set(ClipLeft, convertClipComponent(clip.left(), zoom));
    return InterpolationValue(list.release(), CSSClipNonInterpolableValue::create(ClipAutos(clip)));
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:9,代码来源:CSSClipInterpolationType.cpp

示例7: mapNinePieceImageQuad

LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue& value)
{
    if (!is<CSSPrimitiveValue>(value))
        return LengthBox();

    // Get our zoom value.
    CSSToLengthConversionData conversionData = useSVGZoomRules() ? m_resolver->state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f) : m_resolver->state().cssToLengthConversionData();

    // Retrieve the primitive value.
    auto& borderWidths = downcast<CSSPrimitiveValue>(value);

    // Set up a length box to represent our image slices.
    LengthBox box; // Defaults to 'auto' so we don't have to handle that explicitly below.
    Quad* slices = borderWidths.getQuadValue();
    if (slices->top()->isNumber())
        box.top() = Length(slices->top()->getIntValue(), Relative);
    else if (slices->top()->isPercentage())
        box.top() = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    else if (slices->top()->getValueID() != CSSValueAuto)
        box.top() = slices->top()->computeLength<Length>(conversionData);

    if (slices->right()->isNumber())
        box.right() = Length(slices->right()->getIntValue(), Relative);
    else if (slices->right()->isPercentage())
        box.right() = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    else if (slices->right()->getValueID() != CSSValueAuto)
        box.right() = slices->right()->computeLength<Length>(conversionData);

    if (slices->bottom()->isNumber())
        box.bottom() = Length(slices->bottom()->getIntValue(), Relative);
    else if (slices->bottom()->isPercentage())
        box.bottom() = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    else if (slices->bottom()->getValueID() != CSSValueAuto)
        box.bottom() = slices->bottom()->computeLength<Length>(conversionData);

    if (slices->left()->isNumber())
        box.left() = Length(slices->left()->getIntValue(), Relative);
    else if (slices->left()->isPercentage())
        box.left() = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    else if (slices->left()->getValueID() != CSSValueAuto)
        box.left() = slices->left()->computeLength<Length>(conversionData);

    return box;
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:44,代码来源:CSSToStyleMap.cpp

示例8: positionedObjectMovedOnly

static bool positionedObjectMovedOnly(const LengthBox& a, const LengthBox& b, const Length& width)
{
    // If any unit types are different, then we can't guarantee
    // that this was just a movement.
    if (a.left().type() != b.left().type()
        || a.right().type() != b.right().type()
        || a.top().type() != b.top().type()
        || a.bottom().type() != b.bottom().type())
        return false;

    // Only one unit can be non-auto in the horizontal direction and
    // in the vertical direction.  Otherwise the adjustment of values
    // is changing the size of the box.
    if (!a.left().isIntrinsicOrAuto() && !a.right().isIntrinsicOrAuto())
        return false;
    if (!a.top().isIntrinsicOrAuto() && !a.bottom().isIntrinsicOrAuto())
        return false;
    // If our width is auto and left or right is specified and changed then this
    // is not just a movement - we need to resize to our container.
    if (width.isIntrinsicOrAuto()
        && ((!a.left().isIntrinsicOrAuto() && a.left() != b.left())
            || (!a.right().isIntrinsicOrAuto() && a.right() != b.right())))
        return false;

    // One of the units is fixed or percent in both directions and stayed
    // that way in the new style.  Therefore all we are doing is moving.
    return true;
}
开发者ID:rmacnak-google,项目名称:engine,代码行数:28,代码来源:RenderStyle.cpp


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