1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Stroke clip edges in spectrum views too, improving split appearance

This commit is contained in:
Paul Licameli 2020-01-14 14:35:50 -05:00
parent 98bd937389
commit 97b7572504
4 changed files with 24 additions and 13 deletions

View File

@ -600,6 +600,10 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context,
memDC.SelectObject(converted);
dc.Blit(mid.x, mid.y, mid.width, mid.height, &memDC, 0, 0, wxCOPY, FALSE);
// Draw clip edges, as also in waveform view, which improves the appearance
// of split views
params.DrawClipEdges( dc, rect );
}
}

View File

@ -15,6 +15,7 @@ Paul Licameli split from TrackPanel.cpp
#include <numeric>
#include <wx/graphics.h>
#include "../../../../AColor.h"
#include "../../../../WaveClip.h"
#include "../../../../WaveTrack.h"
@ -909,6 +910,22 @@ ClipParameters::ClipParameters
}
}
void ClipParameters::DrawClipEdges( wxDC &dc, const wxRect &rect ) const
{
// Draw clip edges
dc.SetPen(*wxGREY_PEN);
if (tpre < 0) {
AColor::Line(dc,
mid.x - 1, mid.y,
mid.x - 1, mid.y + rect.height);
}
if (tpost > t1) {
AColor::Line(dc,
mid.x + mid.width, mid.y,
mid.x + mid.width, mid.y + rect.height);
}
}
void WaveTrackView::Reparent( const std::shared_ptr<Track> &parent )
{
// BuildSubViews(); // not really needed

View File

@ -170,6 +170,8 @@ struct ClipParameters
wxRect mid;
int leftOffset;
void DrawClipEdges( wxDC &dc, const wxRect &rect ) const;
};
#endif

View File

@ -903,19 +903,7 @@ void DrawClipWaveform(TrackPanelDrawingContext &context,
if (h == 0.0 && tOffset < 0.0) {
TrackArt::DrawNegativeOffsetTrackArrows( context, rect );
}
// Draw clip edges
dc.SetPen(*wxGREY_PEN);
if (tpre < 0) {
AColor::Line(dc,
mid.x - 1, mid.y,
mid.x - 1, mid.y + rect.height);
}
if (tpost > t1) {
AColor::Line(dc,
mid.x + mid.width, mid.y,
mid.x + mid.width, mid.y + rect.height);
}
params.DrawClipEdges( dc, rect );
}
void DrawTimeSlider( TrackPanelDrawingContext &context,