Skip to content
Permalink
Browse files

Revert "Split lines now only show over middle third of track height."

This was the fix for Bug 800 now considered unsatisfactory.

This reverts commit dc1193a.

(Some merge resolution was needed)
  • Loading branch information...
Paul Licameli
Paul Licameli committed Jul 15, 2017
1 parent 7b93a3a commit c5fc8eef03300e1d3b106f6c8a111602a1b01ad5
Showing with 51 additions and 10 deletions.
  1. +49 −0 src/Menus.cpp
  2. +2 −5 src/TrackArtist.cpp
  3. +0 −5 src/tracks/playabletrack/wavetrack/ui/CutlineHandle.cpp
@@ -5690,6 +5690,55 @@ void AudacityProject::OnSplit()

PushState(_("Split"), _("Split"));
mTrackPanel->Refresh(false);
#if 0
//ANSWER-ME: Do we need to keep this commented out OnSplit() code?
// This whole section no longer used...
/*
* Previous (pre-multiclip) implementation of "Split" command
* This does work only when a range is selected!
*
TrackListIterator iter(mTracks);

Track *n = iter.First();
Track *dest;

TrackList newTracks;

while (n) {
if (n->GetSelected()) {
double sel0 = mViewInfo.selectedRegion.t0();
double sel1 = mViewInfo.selectedRegion.t1();

dest = n->Copy(sel0, sel1);
dest->Init(*n);
dest->SetOffset(wxMax(sel0, n->GetOffset()));

if (sel1 >= n->GetEndTime())
n->Clear(sel0, sel1);
else if (sel0 <= n->GetOffset()) {
n->Clear(sel0, sel1);
n->SetOffset(sel1);
} else
n->Silence(sel0, sel1);

newTracks.Add(dest);
}
n = iter.Next();
}

TrackListIterator nIter(&newTracks);
n = nIter.First();
while (n) {
mTracks->Add(n);
n = nIter.Next();
}

PushState(_("Split"), _("Split"));

FixScrollbars();
mTrackPanel->Refresh(false);
*/
#endif
}

void AudacityProject::OnSplitNew()
@@ -1541,25 +1541,22 @@ void TrackArtist::DrawWaveform(TrackPanelDrawingContext &context,
#endif
const int xx = zoomInfo.TimeToPosition(loc.pos);
if (xx >= 0 && xx < rect.width) {
// delta is used to adjust the top and bottom edge of a split line.
int delta =0;
dc.SetPen( highlight ? AColor::uglyPen : *wxGREY_PEN );
AColor::Line(dc, (int) (rect.x + xx - 1), rect.y, (int) (rect.x + xx - 1), rect.y + rect.height);
if (loc.typ == WaveTrackLocation::locationCutLine) {
dc.SetPen( highlight ? AColor::uglyPen : *wxRED_PEN );
}
else {
delta = rect.height/3;
#ifdef EXPERIMENTAL_DA
// JKC Black does not show up enough.
dc.SetPen(highlight ? AColor::uglyPen : *wxWHITE_PEN);
#else
dc.SetPen(highlight ? AColor::uglyPen : *wxBLACK_PEN);
#endif
}
AColor::Line(dc, (int) (rect.x + xx), rect.y+delta, (int) (rect.x + xx), rect.y - delta + rect.height);
AColor::Line(dc, (int) (rect.x + xx), rect.y, (int) (rect.x + xx), rect.y + rect.height);
dc.SetPen( highlight ? AColor::uglyPen : *wxGREY_PEN );
AColor::Line(dc, (int) (rect.x + xx + 1), rect.y+delta, (int) (rect.x + xx + 1), rect.y - delta + rect.height);
AColor::Line(dc, (int) (rect.x + xx + 1), rect.y, (int) (rect.x + xx + 1), rect.y + rect.height);
}
}

@@ -81,11 +81,6 @@ namespace
locRect.width = 11;
locRect.y = rect.y;
locRect.height = rect.height;
// Adjustment for split line, which only fills one third of track.
if( loc.typ != WaveTrackLocation::locationCutLine ){
locRect.y += rect.height/3;
locRect.height /= 3;
}
if (locRect.Contains(state.m_x, state.m_y))
{
if (pmLocation)

0 comments on commit c5fc8ee

Please sign in to comment.
You can’t perform that action at this time.