mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Merge pull request #4958 from OmrSi/make-extend-to-scene-change-with-gap-always-work
Make extend to scene change with gap work for multiple scene changes
This commit is contained in:
commit
560df50de8
@ -16500,7 +16500,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
var idx = selectedItem.Index;
|
||||
var p = _subtitle.Paragraphs[idx];
|
||||
List<double> nextSceneChanges = audioVisualizer.SceneChanges.Count > 0 ? audioVisualizer.SceneChanges.Where(x => x > p.EndTime.TotalSeconds + 0.01).ToList() : new List<double>();
|
||||
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>();
|
||||
if (nextSceneChanges.Count > 0)
|
||||
{
|
||||
var next = _subtitle.GetParagraphOrDefault(idx + 1);
|
||||
@ -16560,7 +16561,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
var idx = selectedItem.Index;
|
||||
var p = _subtitle.Paragraphs[idx];
|
||||
List<double> previousSceneChanges = audioVisualizer.SceneChanges.Count > 0 ? audioVisualizer.SceneChanges.Where(x => x < p.StartTime.TotalSeconds - 0.01).ToList() : new List<double>();
|
||||
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>();
|
||||
if (previousSceneChanges.Count > 0)
|
||||
{
|
||||
var previous = _subtitle.GetParagraphOrDefault(idx - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user