mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-05 06:59:07 +02:00
Reimplement the narrowed hot zone for vertical ruler...
... Don't define the TrackPanelCell to be narrower. Instead, change its hit-test routine, and only if it is a Wave track. Previous implementation had the unintended consequence, that a click in the area excluded from vertical zooming was treated as a click on the background outside of all tracks, causing de-selection of all tracks.
This commit is contained in:
parent
a7960864dd
commit
095ee9185f
@ -3545,10 +3545,9 @@ void TrackPanelCellIterator::UpdateRect()
|
||||
}
|
||||
case CellType::VRuler:
|
||||
{
|
||||
const int kGuard = 5; // 5 pixels to reduce risk of VZooming accidentally
|
||||
mRect.x = kTrackInfoWidth;
|
||||
// Right edge of the VRuler is inactive.
|
||||
mRect.width = mPanel->GetLeftOffset() - mRect.x -kGuard;
|
||||
mRect.width = mPanel->GetLeftOffset() - mRect.x;
|
||||
mRect.y += kTopMargin;
|
||||
mRect.height -= (kBottomMargin + kTopMargin);
|
||||
}
|
||||
|
@ -31,6 +31,9 @@ std::vector<UIHandlePtr> WaveTrackVRulerControls::HitTest
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
std::vector<UIHandlePtr> results;
|
||||
|
||||
const int kGuard = 5; // 5 pixels to reduce risk of VZooming accidentally
|
||||
if ( st.state.GetX() <= st.rect.GetRight() - kGuard ) {
|
||||
auto pTrack = Track::Pointer<WaveTrack>( FindTrack().get() );
|
||||
if (pTrack) {
|
||||
auto result = std::make_shared<WaveTrackVZoomHandle>(
|
||||
@ -38,6 +41,7 @@ std::vector<UIHandlePtr> WaveTrackVRulerControls::HitTest
|
||||
result = AssignUIHandlePtr(mVZoomHandle, result);
|
||||
results.push_back(result);
|
||||
}
|
||||
}
|
||||
|
||||
auto more = TrackVRulerControls::HitTest(st, pProject);
|
||||
std::copy(more.begin(), more.end(), std::back_inserter(results));
|
||||
|
Loading…
x
Reference in New Issue
Block a user