feat(plot): the figure crosshair marks the hovered row, and the stroke is thin, dashed and configurable

This commit is contained in:
Martino Ferrari committed 2026-09-28 20:17:01 +02:00
1 parent cae672bc99
commit eee7c34dd5
12 files changed
+166 -12

No files matched your search

+7 -4
View File
@@ -494,12 +494,15 @@ void Host::sync_figure_crosshair(const std::vector<Rect>& rows) noexcept {
if (hovered >= row_count) return;
}
// Applied to the whole figure: one x, every row. A row whose controller has *no* crosshair (the
// pointer left its axes, which is the only thing that clears one) clears the figure's, so the
// rows cannot be left showing a hover the pointer has abandoned.
// Applied to the whole figure: one x, every row; and the pointer row's **own** y, only to that
// row -- so the row under the pointer gets the one horizontal line, and no row ever shows
// another row's y (spec §17). The y is the row's own data coordinate, placed by its controller
// from the pointer's pixel row, and it is never spread to a sibling. A row whose controller has
// *no* crosshair (the pointer left its axes, which is the only thing that clears one) clears the
// figure's, so the rows cannot be left showing a hover the pointer has abandoned.
const Plot& row = figure_->plot(hovered);
if (row.crosshair().active) {
figure_->set_crosshair(row.crosshair().x, true);
figure_->set_crosshair(row.crosshair().x, hovered, row.crosshair().y, true);
spread_x_ = row.crosshair().x;
spread_active_ = true;
} else {