本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}