mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-20 14:20:06 +02:00
Reimplement the logic for drawing label track selection background
This commit is contained in:
parent
f8e0ffb31b
commit
c866ed4bf7
@ -797,7 +797,8 @@ void LabelTrack::Draw
|
|||||||
|
|
||||||
TrackArtist::DrawBackgroundWithSelection(&dc, r, this,
|
TrackArtist::DrawBackgroundWithSelection(&dc, r, this,
|
||||||
AColor::labelSelectedBrush, AColor::labelUnselectedBrush,
|
AColor::labelSelectedBrush, AColor::labelUnselectedBrush,
|
||||||
selectedRegion, zoomInfo);
|
selectedRegion, zoomInfo,
|
||||||
|
( GetSelected() || IsSyncLockSelected() ) );
|
||||||
|
|
||||||
wxCoord textWidth, textHeight;
|
wxCoord textWidth, textHeight;
|
||||||
|
|
||||||
|
@ -3139,13 +3139,7 @@ void TrackArtist::DrawLabelTrack(TrackPanelDrawingContext &context,
|
|||||||
const SelectedRegion &selectedRegion,
|
const SelectedRegion &selectedRegion,
|
||||||
const ZoomInfo &zoomInfo)
|
const ZoomInfo &zoomInfo)
|
||||||
{
|
{
|
||||||
double sel0 = selectedRegion.t0();
|
track->Draw(context, rect, selectedRegion, zoomInfo);
|
||||||
double sel1 = selectedRegion.t1();
|
|
||||||
|
|
||||||
if (!track->GetSelected() && !track->IsSyncLockSelected())
|
|
||||||
sel0 = sel1 = 0.0;
|
|
||||||
|
|
||||||
track->Draw(context, rect, SelectedRegion(sel0, sel1), zoomInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackArtist::DrawTimeTrack(TrackPanelDrawingContext &context,
|
void TrackArtist::DrawTimeTrack(TrackPanelDrawingContext &context,
|
||||||
@ -3301,11 +3295,12 @@ void TrackArtist::DrawSyncLockTiles(wxDC *dc, const wxRect &rect)
|
|||||||
|
|
||||||
void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
||||||
const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush,
|
const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush,
|
||||||
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo)
|
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo,
|
||||||
|
bool useSelection)
|
||||||
{
|
{
|
||||||
//MM: Draw background. We should optimize that a bit more.
|
//MM: Draw background. We should optimize that a bit more.
|
||||||
const double sel0 = selectedRegion.t0();
|
const double sel0 = useSelection ? selectedRegion.t0() : 0.0;
|
||||||
const double sel1 = selectedRegion.t1();
|
const double sel1 = useSelection ? selectedRegion.t1() : 0.0;
|
||||||
|
|
||||||
dc->SetPen(*wxTRANSPARENT_PEN);
|
dc->SetPen(*wxTRANSPARENT_PEN);
|
||||||
if (track->GetSelected() || track->IsSyncLockSelected())
|
if (track->GetSelected() || track->IsSyncLockSelected())
|
||||||
|
@ -89,7 +89,8 @@ class AUDACITY_DLL_API TrackArtist {
|
|||||||
// Helper: draws background with selection rect
|
// Helper: draws background with selection rect
|
||||||
static void DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
static void DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
||||||
const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush,
|
const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush,
|
||||||
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo);
|
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo,
|
||||||
|
bool useSelection = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user