feat(plot): crosshair with an interpolated per-signal hover readout

This commit is contained in:
Martino Ferrari committed 2026-09-28 18:57:33 +02:00
1 parent a153b73ead
commit fd0c471430
11 files changed
+809 -22

No files matched your search

+14
View File
@@ -410,4 +410,18 @@ const FigureLayout& Figure::layout() {
return layout_;
}
// ----------------------------------------------------------------- crosshair
void Figure::set_crosshair(f64 x, bool active) {
// One x, every row: the readouts are synced because they are told the same coordinate, not
// because a renderer copies one row's to the others. `Plot::set_crosshair()` refuses a
// coordinate that is not a number, so a garbage value leaves every row's crosshair as it
// was rather than clearing some rows and not others.
for (Plot& row : plots_) row.set_crosshair(x, active);
}
void Figure::clear_crosshair() {
for (Plot& row : plots_) row.clear_crosshair();
}
} // namespace plot