mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Fixed broken graphs with missing time data handling
This commit is contained in:
parent
e6b205e823
commit
a1de3c956c
@ -234,7 +234,8 @@ void GraphItem::updateBounds()
|
||||
}
|
||||
}
|
||||
|
||||
_bounds = QRectF(QPointF(left, top), QPointF(right, bottom));
|
||||
QRectF bounds(QPointF(left, top), QPointF(right, bottom));
|
||||
_bounds = bounds.isValid() ? bounds : QRectF();
|
||||
}
|
||||
|
||||
qreal GraphItem::max() const
|
||||
|
@ -166,6 +166,10 @@ void GraphView::setGraphType(GraphType type)
|
||||
for (int i = 0; i < _graphs.count(); i++) {
|
||||
GraphItem *gi = _graphs.at(i);
|
||||
gi->setGraphType(type);
|
||||
if (gi->bounds().isNull())
|
||||
removeItem(gi);
|
||||
else
|
||||
addItem(gi);
|
||||
_bounds |= gi->bounds();
|
||||
}
|
||||
|
||||
@ -194,6 +198,7 @@ void GraphView::addGraph(GraphItem *graph)
|
||||
SLOT(emitSliderPositionChanged(qreal)));
|
||||
|
||||
_graphs.append(graph);
|
||||
if (!graph->bounds().isNull())
|
||||
_scene->addItem(graph);
|
||||
_bounds |= graph->bounds();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user