Revert "Make extend to scene change with gap work for multiple scene changes"

This commit is contained in:
Omar AL-Shakaki 2021-04-10 15:48:33 +03:00 committed by GitHub
parent 880d5dd1f0
commit 6d714ecf10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16601,8 +16601,7 @@ namespace Nikse.SubtitleEdit.Forms
{
var idx = selectedItem.Index;
var p = _subtitle.Paragraphs[idx];
var endTime = p.EndTime.TotalSeconds + (withGap ? MinGapBetweenLines / TimeCode.BaseUnit + 0.01 : 0.01);
List<double> nextSceneChanges = audioVisualizer.SceneChanges.Count > 0 ? audioVisualizer.SceneChanges.Where(x => x > endTime).ToList() : new List<double>();
List<double> nextSceneChanges = audioVisualizer.SceneChanges.Count > 0 ? audioVisualizer.SceneChanges.Where(x => x > p.EndTime.TotalSeconds + 0.01).ToList() : new List<double>();
if (nextSceneChanges.Count > 0)
{
var next = _subtitle.GetParagraphOrDefault(idx + 1);
@ -16662,8 +16661,7 @@ namespace Nikse.SubtitleEdit.Forms
{
var idx = selectedItem.Index;
var p = _subtitle.Paragraphs[idx];
var startTime = p.StartTime.TotalSeconds - (withGap ? MinGapBetweenLines / TimeCode.BaseUnit + 0.01 : 0.01);
List<double> previousSceneChanges = audioVisualizer.SceneChanges.Count > 0 ? audioVisualizer.SceneChanges.Where(x => x < startTime).ToList() : new List<double>();
List<double> previousSceneChanges = audioVisualizer.SceneChanges.Count > 0 ? audioVisualizer.SceneChanges.Where(x => x < p.StartTime.TotalSeconds - 0.01).ToList() : new List<double>();
if (previousSceneChanges.Count > 0)
{
var previous = _subtitle.GetParagraphOrDefault(idx - 1);