summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-18 08:47:40 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-18 08:47:40 +0200
commitf505a21b064251d8ef55a2c0ca9a8f3609289acf (patch)
tree541fb65af5b0281c51247b574aef26cd0a5a7300
parent8d2c9d5a03962c944bcfddf87878487b3e180005 (diff)
qfc: fix artifacts following cleanup
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.cpp6
1 files changed, 3 insertions, 3 deletions
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<QPointF> 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;