本文整理汇总了C++中Point::IsFinite方法的典型用法代码示例。如果您正苦于以下问题:C++ Point::IsFinite方法的具体用法?C++ Point::IsFinite怎么用?C++ Point::IsFinite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::IsFinite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoveTo
void
PathBuilderCG::QuadraticBezierTo(const Point &aCP1,
const Point &aCP2)
{
if (!aCP1.IsFinite() || !aCP2.IsFinite()) {
return;
}
if (CGPathIsEmpty(mCGPath))
MoveTo(aCP1);
CGPathAddQuadCurveToPoint(mCGPath, nullptr,
aCP1.x, aCP1.y,
aCP2.x, aCP2.y);
}
示例2: CGPathAddArc
void
PathBuilderCG::Arc(const Point &aOrigin, Float aRadius, Float aStartAngle,
Float aEndAngle, bool aAntiClockwise)
{
if (!aOrigin.IsFinite() || !IsFinite(aRadius) ||
!IsFinite(aStartAngle) || !IsFinite(aEndAngle)) {
return;
}
// Disabled for now due to a CG bug when using CGPathAddArc with stroke
// dashing and rotation transforms that are multiples of 90 degrees. See:
// https://bugzilla.mozilla.org/show_bug.cgi?id=949661#c8
#if 0
// Core Graphic's initial coordinate system is y-axis up, whereas Moz2D's is
// y-axis down. Core Graphics therefore considers "clockwise" to mean "sweep
// in the direction of decreasing angle" whereas Moz2D considers it to mean
// "sweep in the direction of increasing angle". In other words if this
// Moz2D method is instructed to sweep anti-clockwise we need to tell
// CGPathAddArc to sweep clockwise, and vice versa. Hence why we pass the
// value of aAntiClockwise directly to CGPathAddArc's "clockwise" bool
// parameter.
CGPathAddArc(mCGPath, nullptr,
aOrigin.x, aOrigin.y,
aRadius,
aStartAngle,
aEndAngle,
aAntiClockwise);
#endif
ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle,
aAntiClockwise);
}
示例3: CGPathMoveToPoint
void
PathBuilderCG::MoveTo(const Point &aPoint)
{
if (!aPoint.IsFinite()) {
return;
}
CGPathMoveToPoint(mCGPath, nullptr, aPoint.x, aPoint.y);
}