From bf30c6198cd51966f9415181c7281ffd8a91793f Mon Sep 17 00:00:00 2001 From: James Crook Date: Sun, 7 Jan 2018 18:27:40 +0000 Subject: [PATCH] Improve mouse wheel zooming Zooming with mouse was virtually unusable before this fix, as the location of interest would move around too much on a zoom in. --- src/tracks/ui/CommonTrackPanelCell.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tracks/ui/CommonTrackPanelCell.cpp b/src/tracks/ui/CommonTrackPanelCell.cpp index 644fe9d12..ecdf26856 100644 --- a/src/tracks/ui/CommonTrackPanelCell.cpp +++ b/src/tracks/ui/CommonTrackPanelCell.cpp @@ -79,6 +79,12 @@ unsigned CommonTrackPanelCell::HandleWheelRotation center_h = viewInfo.h + (pProject->GetScreenEndTime() - viewInfo.h) / 2.0; xx = viewInfo.TimeToPosition(center_h, trackLeftEdge); } + else if( steps > 0 ){ + // When zooming in, keep the selection start where it was. + // This is particularly helpful for a point selection. + center_h = viewInfo.selectedRegion.t0(); + xx = viewInfo.TimeToPosition( center_h, trackLeftEdge); + } else { xx = event.m_x;