mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 11:33:24 +00:00
Removed user-entered lines on the plan, keeping only deco.
Removed the user-entered lines on the plan, keeping only deco, This way the graph looks way prettier and we don't loose any functionality. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
effb7e2fac
commit
a7506848b3
1 changed files with 7 additions and 5 deletions
|
@ -87,7 +87,7 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget* parent): QGraphicsView(parent)
|
||||||
scene()->addItem(depthString);
|
scene()->addItem(depthString);
|
||||||
|
|
||||||
diveBg = new QGraphicsPolygonItem();
|
diveBg = new QGraphicsPolygonItem();
|
||||||
diveBg->setBrush(QBrush(Qt::green));
|
diveBg->setPen(QPen(QBrush(),0));
|
||||||
scene()->addItem(diveBg);
|
scene()->addItem(diveBg);
|
||||||
|
|
||||||
plusDepth = new Button();
|
plusDepth = new Button();
|
||||||
|
@ -233,12 +233,14 @@ void DivePlannerGraphics::createDecoStops()
|
||||||
for (dp = diveplan.dp; dp != NULL; dp = dp->next) {
|
for (dp = diveplan.dp; dp != NULL; dp = dp->next) {
|
||||||
double xpos = timeLine->posAtValue(dp->time / 60.0);
|
double xpos = timeLine->posAtValue(dp->time / 60.0);
|
||||||
double ypos = depthLine->posAtValue(dp->depth / 1000.0);
|
double ypos = depthLine->posAtValue(dp->depth / 1000.0);
|
||||||
|
if(!dp->entered){
|
||||||
QGraphicsLineItem *item = new QGraphicsLineItem(lastx, lasty, xpos, ypos);
|
QGraphicsLineItem *item = new QGraphicsLineItem(lastx, lasty, xpos, ypos);
|
||||||
item->setPen(QPen(QBrush(dp->entered ? Qt::black : Qt::red),0));
|
item->setPen(QPen(QBrush(Qt::red),0));
|
||||||
lastx = xpos;
|
|
||||||
lasty = ypos;
|
|
||||||
scene()->addItem(item);
|
scene()->addItem(item);
|
||||||
lines << item;
|
lines << item;
|
||||||
|
}
|
||||||
|
lastx = xpos;
|
||||||
|
lasty = ypos;
|
||||||
poly.append(QPointF(lastx, lasty));
|
poly.append(QPointF(lastx, lasty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue