Re: [PATCH] Heatmap: Draw lines between data points rather than big dots
> Am 16.10.2016 um 11:56 schrieb Tomaz Canabrava: > > Ack > +1 signature.asc Description: Message signed with OpenPGP using GPGMail ___ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
Re: [PATCH] Heatmap: Draw lines between data points rather than big dots
Ack On Sun, Oct 16, 2016 at 10:24 AM, Rick Walshwrote: > By drawing oversize dots for each data point, dots were overlapping such > that > the change in tissue presssure wasn't displayed at the right time - > typically > out by 1-2 minutes, depending on dive duration. > > Drawing a line between discrete points, the data points don't overlap and > change in tissue pressure is displayed at the right time. > > Signed-off-by: Rick Walsh > --- > profile-widget/diveprofileitem.cpp | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/ > diveprofileitem.cpp > index b44586f..8961741 100644 > --- a/profile-widget/diveprofileitem.cpp > +++ b/profile-widget/diveprofileitem.cpp > @@ -415,15 +415,15 @@ void DivePercentageItem::paint(QPainter *painter, > const QStyleOptionGraphicsItem > return; > painter->save(); > QPen mypen; > + mypen.setWidthF(vAxis->posAtValue(0) - vAxis->posAtValue(4)); > mypen.setCosmetic(false); > - mypen.setWidth(5); > QPolygonF poly = polygon(); > - for (int i = 0, modelDataCount = dataModel->rowCount(); i < > modelDataCount; i++) { > + for (int i = 1, modelDataCount = dataModel->rowCount(); i < > modelDataCount; i++) { > if (i < poly.count()) { > double value = dataModel->index(i, > vDataColumn).data().toDouble(); > mypen.setBrush(QBrush(ColorScale(value))); > painter->setPen(mypen); > - painter->drawPoint(poly[i]); > + painter->drawLine(poly[i - 1], poly[i]); > } > } > painter->restore(); > -- > 2.7.4 > > ___ > subsurface mailing list > subsurface@subsurface-divelog.org > http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface > ___ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
[PATCH] Heatmap: Draw lines between data points rather than big dots
By drawing oversize dots for each data point, dots were overlapping such that the change in tissue presssure wasn't displayed at the right time - typically out by 1-2 minutes, depending on dive duration. Drawing a line between discrete points, the data points don't overlap and change in tissue pressure is displayed at the right time. Signed-off-by: Rick Walsh--- profile-widget/diveprofileitem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index b44586f..8961741 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -415,15 +415,15 @@ void DivePercentageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem return; painter->save(); QPen mypen; + mypen.setWidthF(vAxis->posAtValue(0) - vAxis->posAtValue(4)); mypen.setCosmetic(false); - mypen.setWidth(5); QPolygonF poly = polygon(); - for (int i = 0, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) { + for (int i = 1, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) { if (i < poly.count()) { double value = dataModel->index(i, vDataColumn).data().toDouble(); mypen.setBrush(QBrush(ColorScale(value))); painter->setPen(mypen); - painter->drawPoint(poly[i]); + painter->drawLine(poly[i - 1], poly[i]); } } painter->restore(); -- 2.7.4 ___ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface