mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Fix XData offset in ComparePane
The offset has to be the same as for basic data to keep the sync, XData is not even warranted to start from zero. Fixes a problem reported by Marcen at the users forum.
This commit is contained in:
@@ -740,23 +740,12 @@ ComparePane::dropEvent(QDropEvent *event)
|
||||
// add our xdata, with not points yet...
|
||||
add.data->addXData(xi.key(), x);
|
||||
|
||||
// manage offsets
|
||||
bool first = true;
|
||||
double offset = 0.0f, offsetKM = 0.0f;
|
||||
|
||||
foreach(XDataPoint *p, xi.value()->datapoints) {
|
||||
|
||||
if (p->secs > stop) break;
|
||||
|
||||
if (p->secs >= start) {
|
||||
|
||||
// intervals always start from zero when comparing
|
||||
if (first) {
|
||||
first = false;
|
||||
offset = p->secs;
|
||||
offsetKM = p->km;
|
||||
}
|
||||
|
||||
XDataPoint *addp = new XDataPoint();
|
||||
addp->km = p->km - offsetKM;
|
||||
addp->secs = p->secs - offset;
|
||||
|
||||
Reference in New Issue
Block a user