mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-20 23:51:18 +01:00
Changing NoteTrack height, keep # of piano keys (roughly) constant...
This fix is imperfect, but quick and easy
This commit is contained in:
@@ -210,6 +210,18 @@ double NoteTrack::GetEndTime() const
|
||||
return GetStartTime() + GetSeq().get_real_dur();
|
||||
}
|
||||
|
||||
void NoteTrack::SetHeight(int h)
|
||||
{
|
||||
auto oldHeight = GetHeight();
|
||||
Track::SetHeight(h);
|
||||
Zoom(
|
||||
wxRect{ 0, 0, 1, h }, // only height matters
|
||||
h - 1, // preserve bottom note
|
||||
(float)h / std::max(1, oldHeight),
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void NoteTrack::WarpAndTransposeNotes(double t0, double t1,
|
||||
const TimeWarper &warper,
|
||||
|
||||
Reference in New Issue
Block a user