更新代码
This commit is contained in:
@@ -24,13 +24,13 @@ QPainterPath SmoothCurve::createSmoothCurve(const QVector<QPointF> &points)
|
||||
QPainterPath SmoothCurve::createSmoothCurve2(const QVector<QPointF> &points)
|
||||
{
|
||||
//采用Qt原生方法不做任何处理
|
||||
int count = points.count();
|
||||
if (count == 0) {
|
||||
int size = points.size();
|
||||
if (size == 0) {
|
||||
return QPainterPath();
|
||||
}
|
||||
|
||||
QPainterPath path(points.at(0));
|
||||
for (int i = 0; i < count - 1; ++i) {
|
||||
for (int i = 0; i < size - 1; ++i) {
|
||||
//控制点的 x 坐标为 sp 与 ep 的 x 坐标和的一半
|
||||
//第一个控制点 c1 的 y 坐标为起始点 sp 的 y 坐标
|
||||
//第二个控制点 c2 的 y 坐标为结束点 ep 的 y 坐标
|
||||
|
||||
Reference in New Issue
Block a user