1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-16 08:34:10 +02:00

Implement Shift+Right-click for full extent on the note track VRuler

This commit is contained in:
Pokechu22 2017-06-30 01:09:34 -07:00 committed by Paul Licameli
parent a5df25f762
commit b7d6077af5

View File

@ -161,14 +161,23 @@ UIHandle::Result NoteTrackVZoomHandle::Release
pTrack->ZoomTo(evt.rect, mZoomStart, mZoomEnd);
}
else if (event.ShiftDown() || event.RightUp()) {
if (event.ShiftDown() && event.RightUp()) {
// Zoom out completely
pTrack->SetBottomNote(0);
auto octavePadding = 2 * 10; // 10 octaves times 2 single-pixel seperations per pixel
auto availableHeight = evt.rect.height - octavePadding;
auto numNotes = 128;
auto spacePerNote = availableHeight / numNotes;
pTrack->SetPitchHeight(std::max(spacePerNote, 1));
} else {
// Zoom out
pTrack->ZoomOut(evt.rect, mZoomEnd);
}
}
else {
pTrack->ZoomIn(evt.rect, mZoomEnd);
}
// TODO: shift-right click as in audio track?
mZoomEnd = mZoomStart = 0;
pProject->ModifyState(true);