예제 #1
0
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;
}
예제 #2
0
파일: mgarc.cpp 프로젝트: Vito2015/vgcore
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;
}