diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-05 19:30:54 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-05 19:30:54 -0300 |
commit | 8e35868b9b09f6417809678bd22cc315a696b706 (patch) | |
tree | a76e38d5ca63149c90894c396e8f551a09eb9d2b /qt-ui | |
parent | be0f2e0e8de184380047f71f88cbdf0c23e94bd9 (diff) | |
download | subsurface-8e35868b9b09f6417809678bd22cc315a696b706.tar.gz |
Fixed some bad drawings
Removed the lines of the graphs that doesn't supposed to have lines.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index d5bf177f0..89c3a74fc 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -328,7 +328,6 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct scene()->addItem(line); } - gc->leftx = 0; gc->rightx = maxtime; color = profile_color[MEAN_DEPTH].at(0); @@ -359,6 +358,7 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct QLinearGradient pat(0.0,0.0,0.0,scene()->height()); QGraphicsPolygonItem *neatFill = NULL; + p.append( QPointF(SCALE(gc, 0, 0) )); for (i = 0; i < pi->nr; i++, entry++) p.append( QPointF( SCALE(gc, entry->sec, entry->depth) )); @@ -373,26 +373,28 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct p.append( QPointF( SCALE(gc, entry->sec, entry->depth) )); } } - pat.setColorAt(1, profile_color[DEPTH_BOTTOM].first()); pat.setColorAt(0, profile_color[DEPTH_TOP].first()); neatFill = new QGraphicsPolygonItem(); neatFill->setPolygon(p); neatFill->setBrush(QBrush(pat)); - neatFill->setPen(QPen()); + neatFill->setPen(QPen(QBrush(),0)); scene()->addItem(neatFill); + /* if the user wants the deco ceiling more visible, do that here (this * basically draws over the background that we had allowed to shine * through so far) */ // TODO: port the prefs.profile_red_ceiling to QSettings + //if (prefs.profile_red_ceiling) { p.clear(); pat.setColorAt(0, profile_color[CEILING_SHALLOW].first()); pat.setColorAt(1, profile_color[CEILING_DEEP].first()); entry = pi->entry; + p.append( QPointF(SCALE(gc, 0, 0) )); for (i = 0; i < pi->nr; i++, entry++) { if (entry->ndl == 0 && entry->stopdepth) { if (entry->ndl == 0 && entry->stopdepth < entry->depth) { @@ -408,19 +410,23 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct neatFill = new QGraphicsPolygonItem(); neatFill->setBrush(QBrush(pat)); neatFill->setPolygon(p); - neatFill->setPen(QPen()); + neatFill->setPen(QPen(QBrush(),0)); scene()->addItem(neatFill); //} /* finally, plot the calculated ceiling over all this */ // TODO: Port the profile_calc_ceiling to QSettings // if (prefs.profile_calc_ceiling) { + + qDebug() << "CALC_CEILING_SHALLOW" << profile_color[CALC_CEILING_SHALLOW].first(); + qDebug() << "CALC_CEILING_DEEP" << profile_color[CALC_CEILING_DEEP].first(); + pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first()); pat.setColorAt(1, profile_color[CALC_CEILING_DEEP].first()); entry = pi->entry; p.clear(); - p.append( QPointF(0,0)); + p.append( QPointF(SCALE(gc, 0, 0) )); for (i = 0; i < pi->nr; i++, entry++) { if (entry->ceiling) p.append( QPointF( SCALE(gc, entry->sec, entry->ceiling) )); @@ -430,17 +436,17 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct p.append( QPointF( SCALE(gc, (entry-1)->sec, 0) )); neatFill = new QGraphicsPolygonItem(); neatFill->setPolygon(p); - neatFill->setPen(QPen()); + neatFill->setPen(QPen(QBrush(),0)); + neatFill->setBrush(pat); scene()->addItem(neatFill); //} - /* next show where we have been bad and crossed the dc's ceiling */ pat.setColorAt(0, profile_color[CEILING_SHALLOW].first()); pat.setColorAt(1, profile_color[CEILING_DEEP].first()); entry = pi->entry; p.clear(); - p.append( QPointF(0,0)); + p.append( QPointF(SCALE(gc, 0, 0) )); for (i = 0; i < pi->nr; i++, entry++) p.append( QPointF( SCALE(gc, entry->sec, entry->depth) )); @@ -454,7 +460,7 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct neatFill = new QGraphicsPolygonItem(); neatFill->setPolygon(p); - neatFill->setPen(QPen()); + neatFill->setPen(QPen(QBrush(),0)); neatFill->setBrush(QBrush(pat)); scene()->addItem(neatFill); |