0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-01-11 17:18:10 +03:00

Merge pull request #394 from liufeijin/patch-3

Update lrchartitem.cpp
This commit is contained in:
Alexander Arin 2022-03-24 00:56:44 +03:00 committed by GitHub
commit 87ea7500a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1078,14 +1078,14 @@ void AbstractSeriesChart::paintGrid(QPainter *painter, QRectF gridRect)
if (m_chartItem->horizontalAxisOnTop()) { if (m_chartItem->horizontalAxisOnTop()) {
painter->drawLine(x, gridRect.top() - gridOffset.height(), painter->drawLine(x, gridRect.top() - gridOffset.height(),
x, (drawFullLine ? gridRect.bottom() : gridRect.top())); x, (drawFullLine ? gridRect.bottom() : gridRect.top()));
painter->drawText(QRectF(x - painter->fontMetrics().width(text) / 2, painter->drawText(QRectF(x - painter->fontMetrics().boundingRect(text).width() / 2,
gridRect.top() - (fontHeight + gridOffset.height()), gridRect.top() - (fontHeight + gridOffset.height()),
hStep, fontHeight), hStep, fontHeight),
text); text);
} else { } else {
painter->drawLine(x, gridRect.bottom() + gridOffset.height(), painter->drawLine(x, gridRect.bottom() + gridOffset.height(),
x, (drawFullLine ? gridRect.top() : gridRect.bottom())); x, (drawFullLine ? gridRect.top() : gridRect.bottom()));
painter->drawText(QRectF(x - painter->fontMetrics().width(text) / 2, painter->drawText(QRectF(x - painter->fontMetrics().boundingRect(text).width() / 2,
gridRect.bottom() + halfFontHeight * 0 + gridOffset.height(), gridRect.bottom() + halfFontHeight * 0 + gridOffset.height(),
hStep, fontHeight), hStep, fontHeight),
text); text);