From ebfdff8dc1f84921373b7ea3b379193b6da69b8e Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Tue, 30 May 2023 13:25:36 +0100 Subject: Fix incorred height and width usage --- qmlplugin/hrGraph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmlplugin/hrGraph.cpp b/qmlplugin/hrGraph.cpp index 625300e..5c38026 100644 --- a/qmlplugin/hrGraph.cpp +++ b/qmlplugin/hrGraph.cpp @@ -59,7 +59,7 @@ void HrGraph::paint(QPainter *painter) for(int i = 0; i < j; i++) { calculatedTimeSeconds = (m_filedata.at(i).time - minTime)/timeDelta; calculatedValue = 1 - (m_filedata.at(i).value - minHrValue)/valueDelta; - points[i] = QPointF(m_lineWidth + calculatedTimeSeconds*(height()-2*m_lineWidth), m_lineWidth + calculatedValue*(width()-2*m_lineWidth)); //these +2 -1 are here to make sure that the graph fits within the drawn area, as it will be clipped by qt if it doesn't. + points[i] = QPointF(m_lineWidth + calculatedTimeSeconds*(width()-2*m_lineWidth), m_lineWidth + calculatedValue*(height()-2*m_lineWidth)); //these +2 -1 are here to make sure that the graph fits within the drawn area, as it will be clipped by qt if it doesn't. } QPen pen; pen.setWidthF(m_lineWidth); -- cgit v1.2.3-70-g09d2