fix: clamp max-speed label at edges + move trip location next to time

- placeMaxTick() clamps the label so it stays within the scrubber instead of
  overlapping the time/speed readouts when max speed is near an edge
- give the scrubber row more bottom margin (mb-3) so the tick label clears the
  readout row below
- move the trip location readout directly under the timestamp (left side),
  removing the separate bottom line
This commit is contained in:
Mathieu Moran
2026-08-15 18:14:21 -04:00
parent 0072322bc2
commit 42d7f8eb18
3 changed files with 18 additions and 8 deletions
+8 -2
View File
@@ -168,8 +168,14 @@
}
var ratio = st.maxIndex / (st.points.length - 1);
var thumb = 16; // approximate range thumb width
var usable = Math.max(1, scrubber.clientWidth - thumb);
tick.style.left = (thumb / 2 + ratio * usable) + "px";
var w = scrubber.clientWidth;
var usable = Math.max(1, w - thumb);
var x = thumb / 2 + ratio * usable;
// Keep the centered label inside the scrubber so it doesn't overlap the
// time (left) or speed (right) readouts when max speed is at an edge.
var halfLabel = 24;
x = Math.max(halfLabel, Math.min(w - halfLabel, x));
tick.style.left = x + "px";
tick.hidden = false;
}