From e6252ae11b39098e529f44625e936dca211f5fe2 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 23 Jan 2012 21:01:57 +0000 Subject: [PATCH] Fix adding lead in/out in the timing postprocessor The wrong set of lines were being checked for overlaps resulting in completely broken results. Originally committed to SVN as r6345. --- aegisub/src/dialog_timing_processor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/src/dialog_timing_processor.cpp b/aegisub/src/dialog_timing_processor.cpp index f325e20e3..779166e2a 100644 --- a/aegisub/src/dialog_timing_processor.cpp +++ b/aegisub/src/dialog_timing_processor.cpp @@ -354,10 +354,10 @@ void DialogTimingProcessor::Process() { for (size_t i = 0; i < sorted.size(); ++i) { AssDialogue *cur = sorted[i]; if (addIn) - cur->Start = safe_time(sorted.begin() + i + 1, sorted.end(), cur, cur->Start - leadIn, &AssDialogue::End, &std::max); + cur->Start = safe_time(sorted.rend() - i, sorted.rend(), cur, cur->Start - leadIn, &AssDialogue::End, &std::max); if (addOut) - cur->End = safe_time(sorted.rend() - i, sorted.rend(), cur, cur->End + leadOut, &AssDialogue::Start, &std::min); + cur->End = safe_time(sorted.begin() + i + 1, sorted.end(), cur, cur->End + leadOut, &AssDialogue::Start, &std::min); } }