Prevent the heatmap form overlapping at the ends

...by making the pen start at its first position rather
than first position minus half width.

Sorry for my first attempt to solve this in a totally
differen (read: wrong) way.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2017-01-15 20:12:51 +01:00 committed by Dirk Hohndel
parent c99aaaa323
commit fedadc65db

View file

@ -416,7 +416,7 @@ void DivePercentageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
return; return;
painter->save(); painter->save();
QPen mypen; QPen mypen;
mypen.setWidthF(vAxis->posAtValue(0) - vAxis->posAtValue(4)); mypen.setCapStyle(Qt::FlatCap);
mypen.setCosmetic(false); mypen.setCosmetic(false);
QPolygonF poly = polygon(); QPolygonF poly = polygon();
for (int i = 1, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) { for (int i = 1, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) {