diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-09-28 16:11:49 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-09-29 07:42:48 +0000 |
commit | 7557d1ea51b55c7f01c8ad8518042ee1aebe8f1d (patch) | |
tree | 63c462a536b280778ba613bfb6d61966c10ede8c /src/charts/layout/abstractchartlayout.cpp | |
parent | 2dcfcd4a9f6976067c41adc7202f9414f0a4c369 (diff) |
Fix label clipping issues using QOpenGLWidget as ChartView viewport
Task-number: QTRD-3701
Change-Id: I8efc20300d2aa6065918e02190da746463a5d504
Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>
Diffstat (limited to 'src/charts/layout/abstractchartlayout.cpp')
-rw-r--r-- | src/charts/layout/abstractchartlayout.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/charts/layout/abstractchartlayout.cpp b/src/charts/layout/abstractchartlayout.cpp index 32158988..223600b7 100644 --- a/src/charts/layout/abstractchartlayout.cpp +++ b/src/charts/layout/abstractchartlayout.cpp @@ -156,7 +156,9 @@ QRectF AbstractChartLayout::calculateLegendMinimum(const QRectF &geometry, QLege QRectF AbstractChartLayout::calculateTitleGeometry(const QRectF &geometry, ChartTitle *title) const { title->setGeometry(geometry); - QPointF center = geometry.center() - title->boundingRect().center(); + // Round to full pixel via QPoint to avoid one pixel clipping on the edge in some cases + QPointF center((geometry.center() - title->boundingRect().center()).toPoint()); + title->setPos(center.x(), title->pos().y()); return geometry.adjusted(0, title->boundingRect().height()+1, 0, 0); } |