1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-22 23:30:07 +02:00

Bug1095 -- quantize times when drawing selection backgroun in wave track

This commit is contained in:
Paul Licameli 2015-07-25 20:54:55 -04:00
parent 03984c48a5
commit dc9549df53
2 changed files with 12 additions and 8 deletions

View File

@ -992,11 +992,10 @@ void TrackArtist::DrawNegativeOffsetTrackArrows(wxDC &dc, const wxRect &rect)
void TrackArtist::DrawWaveformBackground(wxDC &dc, int leftOffset, const wxRect &rect, void TrackArtist::DrawWaveformBackground(wxDC &dc, int leftOffset, const wxRect &rect,
const double env[], const double env[],
float zoomMin, float zoomMax, bool dB, float zoomMin, float zoomMax, bool dB,
const SelectedRegion &selectedRegion, double t0, double t1,
const ZoomInfo &zoomInfo, const ZoomInfo &zoomInfo,
bool drawEnvelope, bool bIsSyncLockSelected) bool drawEnvelope, bool bIsSyncLockSelected)
{ {
const double t0 = selectedRegion.t0(), t1 = selectedRegion.t1();
// Visually (one vertical slice of the waveform background, on its side; // Visually (one vertical slice of the waveform background, on its side;
// the "*" is the actual waveform background we're drawing // the "*" is the actual waveform background we're drawing
@ -1728,11 +1727,16 @@ void TrackArtist::DrawClipWaveform(WaveTrack *track,
// Draw the background of the track, outlining the shape of // Draw the background of the track, outlining the shape of
// the envelope and using a colored pen for the selected // the envelope and using a colored pen for the selected
// part of the waveform // part of the waveform
DrawWaveformBackground(dc, leftOffset, mid, {
env, double t0, t1;
zoomMin, zoomMax, dB, t0 = track->LongSamplesToTime(track->TimeToLongSamples(selectedRegion.t0())),
selectedRegion, zoomInfo, drawEnvelope, t1 = track->LongSamplesToTime(track->TimeToLongSamples(selectedRegion.t1()));
!track->GetSelected()); DrawWaveformBackground(dc, leftOffset, mid,
env,
zoomMin, zoomMax, dB,
t0, t1, zoomInfo, drawEnvelope,
!track->GetSelected());
}
WaveDisplay display(hiddenMid.width); WaveDisplay display(hiddenMid.width);
bool isLoadingOD = false;//true if loading on demand block in sequence. bool isLoadingOD = false;//true if loading on demand block in sequence.

View File

@ -154,7 +154,7 @@ class AUDACITY_DLL_API TrackArtist {
void DrawWaveformBackground(wxDC & dc, int leftOffset, const wxRect &rect, void DrawWaveformBackground(wxDC & dc, int leftOffset, const wxRect &rect,
const double env[], const double env[],
float zoomMin, float zoomMax, bool dB, float zoomMin, float zoomMax, bool dB,
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo, double t0, double t1, const ZoomInfo &zoomInfo,
bool drawEnvelope, bool bIsSyncLockSelected); bool drawEnvelope, bool bIsSyncLockSelected);
void DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[], void DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[],
float zoomMin, float zoomMax, bool dB, float zoomMin, float zoomMax, bool dB,