From 096336ed408b4e249d2e8dc98fab6951c24b5c00 Mon Sep 17 00:00:00 2001 From: Emil Sawicki Date: Fri, 21 Jan 2022 08:14:21 +0100 Subject: [PATCH] Fix text offset for vertical lines --- limereport/items/lrchartitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/limereport/items/lrchartitem.cpp b/limereport/items/lrchartitem.cpp index f1b4ed3..6868109 100644 --- a/limereport/items/lrchartitem.cpp +++ b/limereport/items/lrchartitem.cpp @@ -720,11 +720,12 @@ void AbstractSeriesChart::paintVerticalGrid(QPainter *painter, QRectF gridRect) const qreal valuesHMargin = this->valuesHMargin(painter); const int fontHeight = painter->fontMetrics().height(); const int halfFontHeight = fontHeight / 2; + const qreal textPositionOffset = valuesHMargin * 0.2; const QTextOption verticalTextOption(Qt::AlignRight); for (int i = 0 ; i < lineCount ; i++ ) { const qreal y = vStep * i; - painter->drawText(QRectF(gridRect.bottomLeft()-QPointF(fontHeight,y+halfFontHeight), + painter->drawText(QRectF(gridRect.bottomLeft()-QPointF(textPositionOffset,y+halfFontHeight), QSizeF(valuesHMargin,fontHeight)), verticalLabel(i, yAxisData.step(), yAxisData.rangeMin()), verticalTextOption);