mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 00:33:02 +03:00
Fix text offset for vertical lines
This commit is contained in:
parent
dfa378970f
commit
096336ed40
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user