From c014c93c4c3881007c83f7f4cc422deae78c475a Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Fri, 13 Apr 2007 01:29:05 +0000 Subject: [PATCH] Fixed drawing of inactive lines in audio display to prevent it from being drawn over selection. Originally committed to SVN as r1066. --- aegisub/audio_display.cpp | 121 +++++++++++++++++++++++--------------- aegisub/audio_display.h | 1 + aegisub/changelog.txt | 1 + aegisub/options.cpp | 2 +- 4 files changed, 77 insertions(+), 48 deletions(-) diff --git a/aegisub/audio_display.cpp b/aegisub/audio_display.cpp index 000e8e889..4c8d95a7c 100644 --- a/aegisub/audio_display.cpp +++ b/aegisub/audio_display.cpp @@ -260,53 +260,7 @@ void AudioDisplay::UpdateImage(bool weak) { } // Draw previous line - int shadeType = Options.AsInt(_T("Audio Inactive Lines Display Mode")); - if (shadeType == 1 || shadeType == 2) { - dc.SetBrush(wxBrush(Options.AsColour(_T("Audio Line boundary inactive line")))); - int selWidth = Options.AsInt(_T("Audio Line boundaries Thickness")); - AssDialogue *shade; - int shadeX1,shadeX2; - int shadeFrom,shadeTo; - - // Only previous - if (shadeType == 1) { - shadeFrom = this->line_n-1; - shadeTo = shadeFrom+1; - } - - // All - else { - shadeFrom = 0; - shadeTo = grid->GetRows(); - } - - for (int j=shadeFrom;jGetDialogue(j); - - if (shade) { - // Get coordinates - shadeX1 = GetXAtMS(shade->Start.GetMS()); - shadeX2 = GetXAtMS(shade->End.GetMS()); - if (shadeX2 < 0 || shadeX1 > w) continue; - - // Draw over waveform - if (!spectrum) { - int x1 = MAX(0,shadeX1); - int x2 = MIN(w,shadeX2); - dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform Inactive")))); - for (__int64 i=x1;iline_n-1; + shadeTo = shadeFrom+1; + } + + // All + else { + shadeFrom = 0; + shadeTo = grid->GetRows(); + } + + for (int j=shadeFrom;jGetDialogue(j); + + if (shade) { + // Get coordinates + shadeX1 = GetXAtMS(shade->Start.GetMS()); + shadeX2 = GetXAtMS(shade->End.GetMS()); + if (shadeX2 < 0 || shadeX1 > w) continue; + + // Draw over waveform + if (!spectrum) { + // Selection + int selX1 = MAX(0,GetXAtMS(curStartMS)); + int selX2 = MIN(w,GetXAtMS(curEndMS)); + + // Get ranges (x1->x2, x3->x4). + int x1 = MAX(0,shadeX1); + int x2 = MIN(w,shadeX2); + int x3 = MAX(x1,selX2); + int x4 = MAX(x2,selX2); + + // Clip first range + x1 = MIN(x1,selX1); + x2 = MIN(x2,selX1); + + // Set pen and draw + dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform Inactive")))); + for (int i=x1;i 0:00:00.00 lines. (AMZ) - Added a "Scale Border and Shadow" check box to script properties dialog. (AMZ) +- Fixed drawing of inactive lines in audio display to prevent it from being drawn over selection. (AMZ) = 1.10 beta - 2006.08.07 =========================== diff --git a/aegisub/options.cpp b/aegisub/options.cpp index 9abc1d935..65376e173 100644 --- a/aegisub/options.cpp +++ b/aegisub/options.cpp @@ -250,7 +250,7 @@ void OptionsManager::LoadDefaults() { SetColour(_T("Audio Selection Background Modified"),wxColour(92,0,0)); SetColour(_T("Audio Selection Background"),wxColour(64,64,64)); SetColour(_T("Audio Seconds Boundaries"),wxColour(0,100,255)); - SetColour(_T("Audio Waveform Modified"),wxColour(255,200,200)); + SetColour(_T("Audio Waveform Modified"),wxColour(255,230,230)); SetColour(_T("Audio Waveform Selected"),wxColour(255,255,255)); SetColour(_T("Audio Waveform Inactive"),wxColour(0,80,0)); SetColour(_T("Audio Waveform"),wxColour(0,200,0));