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


C++ SVGPathTraversalState::ShouldUpdateLengthAndControlPoints方法代码示例

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


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

示例1: fabs

static void
TraverseLinetoVerticalRel(const float* aArgs, SVGPathTraversalState& aState)
{
  aState.pos.y += aArgs[0];
  if (aState.ShouldUpdateLengthAndControlPoints()) {
    aState.length += fabs(aArgs[0]);
    aState.cp1 = aState.cp2 = aState.pos;
  }
}
开发者ID:ehsan,项目名称:mozilla-history,代码行数:9,代码来源:SVGPathSegUtils.cpp

示例2: gfxPoint

static void
TraverseMovetoRel(const float* aArgs, SVGPathTraversalState& aState)
{
  aState.start = aState.pos += gfxPoint(aArgs[0], aArgs[1]);
  if (aState.ShouldUpdateLengthAndControlPoints()) {
    // aState.length is unchanged, since move commands don't affect path length.
    aState.cp1 = aState.cp2 = aState.start;
  }
}
开发者ID:ehsan,项目名称:mozilla-history,代码行数:9,代码来源:SVGPathSegUtils.cpp

示例3: CalcDistanceBetweenPoints

static void
TraverseClosePath(const float* aArgs, SVGPathTraversalState& aState)
{
  if (aState.ShouldUpdateLengthAndControlPoints()) {
    aState.length += CalcDistanceBetweenPoints(aState.pos, aState.start);
    aState.cp1 = aState.cp2 = aState.start;
  }
  aState.pos = aState.start;
}
开发者ID:ehsan,项目名称:mozilla-history,代码行数:9,代码来源:SVGPathSegUtils.cpp

示例4: to

static void
TraverseLinetoVerticalAbs(const float* aArgs, SVGPathTraversalState& aState)
{
  gfxPoint to(aState.pos.x, aArgs[0]);
  if (aState.ShouldUpdateLengthAndControlPoints()) {
    aState.length += fabs(to.y - aState.pos.y);
    aState.cp1 = aState.cp2 = to;
  }
  aState.pos = to;
}
开发者ID:ehsan,项目名称:mozilla-history,代码行数:10,代码来源:SVGPathSegUtils.cpp

示例5: to

static void
TraverseLinetoHorizontalAbs(const float* aArgs, SVGPathTraversalState& aState)
{
  Point to(aArgs[0], aState.pos.y);
  if (aState.ShouldUpdateLengthAndControlPoints()) {
    aState.length += fabs(to.x - aState.pos.x);
    aState.cp1 = aState.cp2 = to;
  }
  aState.pos = to;
}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:10,代码来源:SVGPathSegUtils.cpp

示例6: radii

static void
TraverseArcRel(const float* aArgs, SVGPathTraversalState& aState)
{
  Point to = aState.pos + Point(aArgs[5], aArgs[6]);
  if (aState.ShouldUpdateLengthAndControlPoints()) {
    float dist = 0;
    Point radii(aArgs[0], aArgs[1]);
    Point bez[4] = { aState.pos, Point(0, 0), Point(0, 0), Point(0, 0) };
    nsSVGArcConverter converter(aState.pos, to, radii, aArgs[2],
                                aArgs[3] != 0, aArgs[4] != 0);
    while (converter.GetNextSegment(&bez[1], &bez[2], &bez[3])) {
      dist += CalcBezLengthHelper(bez, 4, 0, SplitCubicBezier);
      bez[0] = bez[3];
    }
    aState.length += dist;
    aState.cp1 = aState.cp2 = to;
  }
  aState.pos = to;
}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:19,代码来源:SVGPathSegUtils.cpp


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