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:
parent
a5df25f762
commit
b7d6077af5
@ -161,14 +161,23 @@ UIHandle::Result NoteTrackVZoomHandle::Release
|
||||
pTrack->ZoomTo(evt.rect, mZoomStart, mZoomEnd);
|
||||
}
|
||||
else if (event.ShiftDown() || event.RightUp()) {
|
||||
pTrack->ZoomOut(evt.rect, mZoomEnd);
|
||||
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user