mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-22 06:44:24 +02:00
Fixed the instant-resize-after-first-load issue
This commit is contained in:
@ -24,28 +24,33 @@ void CadenceGraph::setInfo()
|
||||
clearInfo();
|
||||
}
|
||||
|
||||
void CadenceGraph::loadData(const Data &data, const QList<PathItem *> &paths)
|
||||
QList<GraphItem*> CadenceGraph::loadData(const Data &data)
|
||||
{
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
const Graph &graph = data.tracks().at(i)->cadence();
|
||||
|
||||
if (graph.size() < 2) {
|
||||
skipColor();
|
||||
continue;
|
||||
graphs.append(0);
|
||||
} else {
|
||||
CadenceGraphItem *gi = new CadenceGraphItem(graph, _graphType);
|
||||
GraphView::addGraph(gi);
|
||||
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
|
||||
graphs.append(gi);
|
||||
}
|
||||
|
||||
CadenceGraphItem *gi = new CadenceGraphItem(graph, _graphType);
|
||||
GraphView::addGraph(gi, paths.at(i));
|
||||
|
||||
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
|
||||
}
|
||||
|
||||
for (int i = 0; i < data.routes().count(); i++)
|
||||
for (int i = 0; i < data.routes().count(); i++) {
|
||||
skipColor();
|
||||
graphs.append(0);
|
||||
}
|
||||
|
||||
setInfo();
|
||||
|
||||
redraw();
|
||||
|
||||
return graphs;
|
||||
}
|
||||
|
||||
qreal CadenceGraph::avg() const
|
||||
|
Reference in New Issue
Block a user