1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Reviewed use of Track::GetY; don't use in NoteTrack; fix off-by-1's

This commit is contained in:
Paul Licameli
2017-06-03 23:20:37 -04:00
parent acd55e95db
commit 5395f253bf
5 changed files with 34 additions and 22 deletions

View File

@@ -4289,12 +4289,18 @@ void TrackPanel::HandleVZoomButtonUp( wxMouseEvent & event )
// which we then return
if (mCapturedTrack->GetKind() == Track::Note) {
NoteTrack *nt = (NoteTrack *) mCapturedTrack;
const wxRect rect{
GetLeftOffset(),
mCapturedTrack->GetY() + kTopMargin,
GetSize().GetWidth() - GetLeftOffset(),
mCapturedTrack->GetHeight() - (kTopMargin + kBottomMargin)
};
if (IsDragZooming()) {
nt->ZoomTo(mZoomStart, mZoomEnd);
nt->ZoomTo(rect, mZoomStart, mZoomEnd);
} else if (event.ShiftDown() || event.RightUp()) {
nt->ZoomOut(mZoomEnd);
nt->ZoomOut(rect, mZoomEnd);
} else {
nt->ZoomIn(mZoomEnd);
nt->ZoomIn(rect, mZoomEnd);
}
mZoomEnd = mZoomStart = 0;
Refresh(false);
@@ -9611,6 +9617,7 @@ void TrackInfo::DrawVelocitySlider(wxDC *dc, NoteTrack *t, wxRect rect, bool cap
LWSlider * TrackInfo::GainSlider(WaveTrack *t, bool captured) const
{
// PRL: Add the inset, but why not also the border?
wxRect rect(kLeftInset, t->GetY() - pParent->GetViewInfo()->vpos + kTopInset, 1, t->GetHeight());
wxRect sliderRect;
GetGainRect(rect, sliderRect);
@@ -9628,6 +9635,7 @@ LWSlider * TrackInfo::GainSlider(WaveTrack *t, bool captured) const
LWSlider * TrackInfo::PanSlider(WaveTrack *t, bool captured) const
{
// PRL: Add the inset, but why not also the border?
wxRect rect(kLeftInset, t->GetY() - pParent->GetViewInfo()->vpos + kTopInset, 1, t->GetHeight());
wxRect sliderRect;
GetPanRect(rect, sliderRect);
@@ -9646,6 +9654,7 @@ LWSlider * TrackInfo::PanSlider(WaveTrack *t, bool captured) const
#ifdef EXPERIMENTAL_MIDI_OUT
LWSlider * TrackInfo::VelocitySlider(NoteTrack *t, bool captured) const
{
// PRL: Add the inset, but why not also the border?
wxRect rect(kLeftInset, t->GetY() - pParent->GetViewInfo()->vpos + kTopInset, 1, t->GetHeight());
wxRect sliderRect;
GetVelocityRect(rect, sliderRect);