Skip to content

Comparer: zoom metric graph with the mouse wheel (#17)#40

Merged
chammoru merged 1 commit into
masterfrom
feature/comparer-graph-zoom
May 27, 2026
Merged

Comparer: zoom metric graph with the mouse wheel (#17)#40
chammoru merged 1 commit into
masterfrom
feature/comparer-graph-zoom

Conversation

@chammoru
Copy link
Copy Markdown
Owner

Closes #17.

  • Adds an X-axis view range to MetricCal (mViewStartFrame / mViewEndFrame). Drawing now samples from the visible range instead of always from frame 0 to the last parsed frame.
  • FrmsInfoView::OnMouseWheel forwards the cursor's X within the graph to MetricCal::ZoomAtX, which zooms ~25% per wheel notch and re-anchors the new range so the frame under the cursor stays at the same pixel.
  • Double-clicking the graph area resets the view to the full parsed range.
  • View resets automatically when a new source is loaded (Update() calls ResetView()).

How to try

  • Open two video sources, let metrics scan a while.
  • Scroll the mouse wheel over the metric graph — it should zoom around the cursor.
  • Double-click to return to the overview.

Add an X-axis frame range to MetricCal (mViewStartFrame/mViewEndFrame)
and consult it instead of the whole parsed run when laying out samples.
FrmsInfoView::OnMouseWheel forwards the cursor position to
MetricCal::ZoomAtX, which zooms ~25% per notch and re-anchors the new
view so the frame under the cursor stays at the same pixel.
Double-clicking the graph restores the full-range view.
@chammoru chammoru merged commit 467c6d1 into master May 27, 2026
1 check passed
@chammoru chammoru deleted the feature/comparer-graph-zoom branch May 27, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comparer: zoom frame graphs with the mouse wheel

1 participant