fix: only a window change sets the time scale; a fit states the whole of it
The time scale is more than the axis: it is also the trigger's event span, the buffer partition and the control's readout. A zoom or a pan was already clean -- the controller writes the member axis and `clamp_to_data()` caps the span -- but both fits moved `window_s_` alone and only restated the control. The event span then stayed on the previous window until the next decade step or unit change applied the fitted value for real, so one action changed the time scale twice. `apply_window_scale()` is split out of `apply_time_window()` for the fits to use: it moves the partition, the event span, the control and the session, and leaves the view alone, because `set_time_window()` re-arms the live follow and would throw a held event or a paused view back onto the stream. The fits report the span they framed, `fit_all()` delegates its x half to `fit_x()` so the two cannot drift, and the probe drives the menu handlers rather than `RowSet` so it sees the half that lives there. `[fit-probe]` gained `event_span=`, which must equal `window=` on every line. Also moves the plotter pin to 03c41ad (three build warnings, no behaviour). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f6738031a
commit
9888fd9977
7 files changed
+128
-63
No files matched your search
+14
-5
@@ -301,7 +301,14 @@ class RowSet {
|
||||
/// Frames the x window on the data row 0 holds, leaving every y axis alone. The x
|
||||
/// counterpart of `fit_all()`, for the one thing the y axes cannot say: how wide the
|
||||
/// window should be.
|
||||
void fit_x();
|
||||
///
|
||||
/// Reports the span it framed in `span` and `true` when it framed one at all (row 0 may hold
|
||||
/// no data, and a degenerate range is refused). **The caller owes the rest of the time
|
||||
/// scale**: this moves the view and `window_s_`, and the trigger's event span, the buffer
|
||||
/// partition and the window control are the caller's to move with it -- see
|
||||
/// `apply_window_scale()` in `ui.cpp`. Leaving them behind is what made a fit and the control
|
||||
/// disagree about what the window was.
|
||||
bool fit_x(double& span);
|
||||
|
||||
/// Adopts the instruments a gesture is moving, on `drag_row` (the row whose controller holds
|
||||
/// a cursor), and nothing otherwise.
|
||||
@@ -337,10 +344,12 @@ class RowSet {
|
||||
void pin_event_window(double pre_s, double post_s);
|
||||
|
||||
/// Fits every row's y axis to the data it holds, and re-frames the shared x window
|
||||
/// on what row 0 retains (the same thing the plot's own `f` key does). The window
|
||||
/// the toolbar reports becomes the fitted span, so the dropdown can say what is
|
||||
/// actually on screen.
|
||||
void fit_all();
|
||||
/// on what row 0 retains (the same thing the plot's own `f` key does).
|
||||
///
|
||||
/// Reports the framed x span exactly as `fit_x()` does, and leaves the caller the same debt:
|
||||
/// the y fit is this object's business alone, but the x span is the *time scale*, and the
|
||||
/// trigger's event span, the buffer partition and the window control have to move with it.
|
||||
bool fit_all(double& span);
|
||||
|
||||
/// Reports the left gutter the rows currently need, and reserves at least the width
|
||||
/// of the widest *plausible* y label.
|
||||
|
||||
Reference in new issue
Block a user