diff --git a/src/pulsescopewidget.cpp b/src/pulsescopewidget.cpp index 8ce1657a4b3c4269853d2509923f3b3bf722b521..e049b7398bc17d81e222f29462a000e6ed3ae18b 100644 --- a/src/pulsescopewidget.cpp +++ b/src/pulsescopewidget.cpp @@ -58,7 +58,7 @@ PulseScopeWidget::PulseScopeWidget(QWidget *parent) : QGraphicsView(parent), setScene(&m_scene); - m_data.fill(0.0, m_scopeSizeH); + m_data.fill(0.0, qRound(m_scopeSizeH)); drawCurve(m_data); } @@ -78,8 +78,8 @@ void PulseScopeWidget::drawCurve(const QVector<double>& vector) { m_data = vector; - QPainterPath pulsePath(QPoint(0.0, m_scopeSizeV)); - for(int i = 0; i < m_scopeSizeH; ++i) { + QPainterPath pulsePath(QPointF(0.0, m_scopeSizeV - m_data.at(0))); + for(int i = 1; i < m_scopeSizeH; ++i) { pulsePath.lineTo(i, m_scopeSizeV - m_data.at(i)); } if(m_path == NULL) {