traces: warn on negative offsets

This commit is contained in:
Matthias Wirth
2025-09-09 12:33:43 +00:00
parent fe7b68dbfb
commit 76625d57ae
2 changed files with 7 additions and 1 deletions

View File

@@ -3020,8 +3020,13 @@ function normalizeTraceStamps(data) {
}
let trace = data.trace;
let last = 0;
let negOffsetWarned = 0;
for (let i = 0; i < trace.length; i++) {
let point = trace[i];
if (point[0] < 0 && !negOffsetWarned) {
negOffsetWarned = 1;
console.log('negative offset in trace');
}
point[0] += data.timestamp;
if (point[0] >= last) {
last = point[0];

View File

@@ -6660,8 +6660,9 @@ function legShift(offset, plane) {
if (traceOpts.startStamp != null && timestamp < traceOpts.startStamp) {
continue;
}
if (traceOpts.endStamp != null && timestamp > traceOpts.endStamp)
if (traceOpts.endStamp != null && timestamp > traceOpts.endStamp) {
break;
}
if (legStart == null) {
legStart = i;
i++;