From f0be0d6774620ed47a8da43b21f6a8b3541ff009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 23 Feb 2021 22:35:59 +0100 Subject: [PATCH] Fixed broken path<->graph binding setup fixes #348 --- src/GUI/gui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 8469da10..14b7dbe0 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -880,7 +880,6 @@ void GUI::loadData(const Data &data) paths = _mapView->loadData(data); GraphTab *gt = static_cast(_graphTabWidget->currentWidget()); - int index = _graphTabWidget->currentIndex(); for (int i = 0; i < paths.count(); i++) { PathItem *pi = paths.at(i); @@ -890,8 +889,8 @@ void GUI::loadData(const Data &data) for (int j = 0; j < graphs.count(); j++) pi->addGraph(graphs.at(j).at(i)); - if (gt && index >= 0) { - pi->setGraph(index); + if (gt) { + pi->setGraph(_tabs.indexOf(gt)); pi->setMarkerPosition(gt->sliderPosition()); } }