- p.setPen(QPen(Qt::black, 1, Qt::SolidLine));
- for (x = 0 ; x < wWidth ; ++x) {
- normalizedX = x / (double)wWidth;
- curY = wHeight - m_spline.value(normalizedX, true) * wHeight;
-
- /*
- * Keep in mind that QLineF rounds doubles
- * to ints mathematically, not just rounds down
- * like in C
- */
- p.drawLine(QLineF(prevX, prevY, x, curY));
- prevX = x;
- prevY = curY;
+ QPainterPath splinePath(QPointF(point.p.x(), point.p.y()));
+ for (int i = 0; i < max; ++i) {
+ point = m_spline.getPoint(i, wWidth, wHeight, true);
+ next = m_spline.getPoint(i + 1, wWidth, wHeight, true);
+ splinePath.cubicTo(point.h2, next.h1, next.p);