From 6659e2ffa79f86134ac72c62690a72a978015fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 19 Dec 2015 20:49:22 +0100 Subject: [PATCH] Fixed slider info value on unit change --- src/graph.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/graph.cpp b/src/graph.cpp index c1755e4e..35b735ca 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -210,6 +210,10 @@ void Graph::resize(const QSizeF &size) _slider->setPos(QPointF(sp * r.width(), r.bottom())); _scene->addItem(_slider); + const QPainterPath &path = _graphs.at(0)->path(); + QPointF p = path.pointAtPercent(sp); + _sliderInfo->setText(QString::number(-p.y() * _yScale, 'f', _precision)); + r = _scene->itemsBoundingRect(); _info->setPos(r.topLeft() + QPointF(r.width()/2 - _info->boundingRect().width()/2, -_info->boundingRect().height()));