From f505a21b064251d8ef55a2c0ca9a8f3609289acf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 18 Sep 2014 08:47:40 +0200 Subject: qfc: fix artifacts following cleanup --- qfunctionconfigurator/qfunctionconfigurator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qfunctionconfigurator/qfunctionconfigurator.cpp') diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index 17431986..2e60476a 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -192,9 +192,9 @@ void QFunctionConfigurator::paintEvent(QPaintEvent *e) if (_config) { QPen pen(Qt::white, 1, Qt::SolidLine); QList points = _config->getPoints(); - if (moving_control_point_idx >= 0 && moving_control_point_idx < points.size()) { - QPointF prev; - for (int i = 0; i < points.size(); i++) { + if (points.size() && moving_control_point_idx >= 0 && moving_control_point_idx < points.size()) { + QPointF prev = points[0]; + for (int i = 1; i < points.size(); i++) { auto tmp = point_to_pixel(points[i]); drawLine(&p, prev, tmp, pen); prev = tmp; -- cgit v1.2.3