Wrong path in spline.

--HG--
branch : develop
This commit is contained in:
dismine 2013-10-22 16:39:51 +03:00
parent 4a89486f8d
commit 76ca37642c

View File

@ -601,9 +601,13 @@ qreal VSpline::CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2){
QPainterPath VSpline::GetPath() const{ QPainterPath VSpline::GetPath() const{
QPainterPath splinePath; QPainterPath splinePath;
QVector<QPointF> points = GetPoints (); QVector<QPointF> points = GetPoints ();
splinePath.moveTo(points[0]); if(points.count() >= 2){
for (qint32 i = 1; i < points.count(); ++i){ for (qint32 i = 0; i < points.count()-1; ++i){
splinePath.lineTo(points[i]); splinePath.moveTo(points[i]);
splinePath.lineTo(points[i+1]);
}
} else {
qWarning()<<"points.count() < 2"<<Q_FUNC_INFO;
} }
return splinePath; return splinePath;
} }