From 76625d57ae1e55c3dab4c97fa1a43c71562d99ca Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Tue, 9 Sep 2025 12:33:43 +0000 Subject: [PATCH] traces: warn on negative offsets --- html/planeObject.js | 5 +++++ html/script.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/html/planeObject.js b/html/planeObject.js index 47d2aa5..782a2a7 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -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]; diff --git a/html/script.js b/html/script.js index 504b3f7..6e6355d 100644 --- a/html/script.js +++ b/html/script.js @@ -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++;