1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Fixed slider info value on unit change

This commit is contained in:
Martin Tůma 2015-12-19 20:49:22 +01:00
parent 141226b509
commit 6659e2ffa7

View File

@ -210,6 +210,10 @@ void Graph::resize(const QSizeF &size)
_slider->setPos(QPointF(sp * r.width(), r.bottom())); _slider->setPos(QPointF(sp * r.width(), r.bottom()));
_scene->addItem(_slider); _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(); r = _scene->itemsBoundingRect();
_info->setPos(r.topLeft() + QPointF(r.width()/2 _info->setPos(r.topLeft() + QPointF(r.width()/2
- _info->boundingRect().width()/2, -_info->boundingRect().height())); - _info->boundingRect().width()/2, -_info->boundingRect().height()));