mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 17:09:26 +02:00
Move drawing of snap guidelines out of TrackPanel.cpp
This commit is contained in:
parent
198dbc4c2a
commit
a3037b5734
13
src/Snap.cpp
13
src/Snap.cpp
@ -408,3 +408,16 @@ bool SnapManager::Snap(Track *currentTrack,
|
|||||||
|
|
||||||
return SNAP_OFF;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -28,6 +28,7 @@ class WaveClip;
|
|||||||
class WaveTrack;
|
class WaveTrack;
|
||||||
class TrackList;
|
class TrackList;
|
||||||
class ZoomInfo;
|
class ZoomInfo;
|
||||||
|
class wxDC;
|
||||||
|
|
||||||
class TrackClip
|
class TrackClip
|
||||||
{
|
{
|
||||||
@ -101,6 +102,8 @@ public:
|
|||||||
static const wxString & GetSnapValue(int index);
|
static const wxString & GetSnapValue(int index);
|
||||||
static int GetSnapIndex(const wxString & value);
|
static int GetSnapIndex(const wxString & value);
|
||||||
|
|
||||||
|
static void Draw( wxDC *dc, wxInt64 left, wxInt64 right );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void Reinit();
|
void Reinit();
|
||||||
|
@ -7364,15 +7364,8 @@ void TrackPanel::DrawEverythingElse(wxDC * dc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw snap guidelines if we have any
|
// Draw snap guidelines if we have any
|
||||||
if ( mSnapManager && ( GetSnapLeft() >= 0 || GetSnapRight() >= 0 )) {
|
if ( mSnapManager )
|
||||||
AColor::SnapGuidePen(dc);
|
mSnapManager->Draw( dc, GetSnapLeft(), GetSnapRight() );
|
||||||
if ( GetSnapLeft() >= 0 ) {
|
|
||||||
AColor::Line(*dc, (int)GetSnapLeft(), 0, GetSnapLeft(), 30000);
|
|
||||||
}
|
|
||||||
if ( GetSnapRight() >= 0 ) {
|
|
||||||
AColor::Line(*dc, (int)GetSnapRight(), 0, GetSnapRight(), 30000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draw zooming indicator that shows the region that will
|
/// Draw zooming indicator that shows the region that will
|
||||||
|
Loading…
x
Reference in New Issue
Block a user