bool MgArc::setCenterRadius(const Point2d& center, float radius, float startAngle, float sweepAngle) { _points[0] = center; _points[1] = center.polarPoint(startAngle, radius); _points[2] = center.polarPoint(startAngle + sweepAngle, radius); _points[3] = center.polarPoint(startAngle + sweepAngle / 2, radius); _update(); return true; }
bool MgArc::setCenterRadius(const Point2d& center, float radius, float startAngle, float sweepAngle) { if (sweepAngle > _M_2PI - 1e-3) sweepAngle = _M_2PI; else if (sweepAngle < 1e-3 - _M_2PI) sweepAngle = -_M_2PI; _sweepAngle = sweepAngle; _points[0] = center; _points[1] = center.polarPoint(startAngle, radius); _points[2] = center.polarPoint(startAngle + sweepAngle, radius); _points[3] = center.polarPoint(startAngle + sweepAngle / 2, radius); _update(); return true; }