Commit b044df22 authored by Halla Rempt's avatar Halla Rempt
Browse files

Let Qt draw the polyline

We used to draw lines ourselves, giving a bad result.

CCBUG:297595
parent b9a260cf
......@@ -269,12 +269,12 @@ void KisCurveWidget::paintEvent(QPaintEvent *)
p.setRenderHint(QPainter::Antialiasing);
// Draw curve.
double prevY = wHeight - d->m_curve.value(0.) * wHeight;
double prevX = 0.;
double curY;
double normalizedX;
int x;
QPolygonF poly;
p.setPen(QPen(Qt::black, 1, Qt::SolidLine));
for (x = 0 ; x < wWidth ; x++) {
normalizedX = double(x) / wWidth;
......@@ -285,13 +285,10 @@ void KisCurveWidget::paintEvent(QPaintEvent *)
* to ints mathematically, not just rounds down
* like in C
*/
p.drawLine(QLineF(prevX, prevY,
x, curY));
prevX = x;
prevY = curY;
poly.append(QPointF(x, curY));
}
p.drawLine(QLineF(prevX, prevY ,
x, wHeight - d->m_curve.value(1.0) * wHeight));
poly.append(QPointF(x, wHeight - d->m_curve.value(1.0) * wHeight));
p.drawPolyline(poly);
// Drawing curve handles.
double curveX;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment