1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

Move drawing of snap guidelines out of TrackPanel.cpp

This commit is contained in:
Paul Licameli 2017-06-10 20:48:02 -04:00
parent 198dbc4c2a
commit a3037b5734
3 changed files with 18 additions and 9 deletions

View File

@ -408,3 +408,16 @@ bool SnapManager::Snap(Track *currentTrack,
return SNAP_OFF;
}
#include "AColor.h"
void SnapManager::Draw( wxDC *dc, wxInt64 left, wxInt64 right )
{
AColor::SnapGuidePen(dc);
if ( left >= 0 ) {
AColor::Line(*dc, (int)left, 0, (int)left, 30000);
}
if ( right >= 0 ) {
AColor::Line(*dc, (int)right, 0, (int)right, 30000);
}
}

View File

@ -28,6 +28,7 @@ class WaveClip;
class WaveTrack;
class TrackList;
class ZoomInfo;
class wxDC;
class TrackClip
{
@ -101,6 +102,8 @@ public:
static const wxString & GetSnapValue(int index);
static int GetSnapIndex(const wxString & value);
static void Draw( wxDC *dc, wxInt64 left, wxInt64 right );
private:
void Reinit();

View File

@ -7364,15 +7364,8 @@ void TrackPanel::DrawEverythingElse(wxDC * dc,
}
// Draw snap guidelines if we have any
if ( mSnapManager && ( GetSnapLeft() >= 0 || GetSnapRight() >= 0 )) {
AColor::SnapGuidePen(dc);
if ( GetSnapLeft() >= 0 ) {
AColor::Line(*dc, (int)GetSnapLeft(), 0, GetSnapLeft(), 30000);
}
if ( GetSnapRight() >= 0 ) {
AColor::Line(*dc, (int)GetSnapRight(), 0, GetSnapRight(), 30000);
}
}
if ( mSnapManager )
mSnapManager->Draw( dc, GetSnapLeft(), GetSnapRight() );
}
/// Draw zooming indicator that shows the region that will