mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
More on #7560
This commit is contained in:
parent
08bf6ee69a
commit
18d14f650e
@ -18575,11 +18575,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var p = _subtitle.Paragraphs[index];
|
||||
var videoTimeCode = new TimeCode(videoPositionMs);
|
||||
var duration = videoTimeCode.TotalMilliseconds - p.StartTime.TotalMilliseconds - MinGapBetweenLines;
|
||||
if (duration > 0 &&
|
||||
if (duration > 0.01 &&
|
||||
duration <= 60_000)
|
||||
{
|
||||
MakeHistoryForUndoOnlyIfNotRecent(string.Format(_language.VideoControls.BeforeChangingTimeInWaveformX, "#" + _subtitle.Paragraphs[index].Number + " " + _subtitle.Paragraphs[index].Text));
|
||||
var newEndTime = new TimeCode(videoTimeCode.TotalMilliseconds - MinGapBetweenLines);
|
||||
var newEndTime = new TimeCode(videoTimeCode.TotalMilliseconds - (double)MinGapBetweenLines);
|
||||
double charactersPerSecond = Utilities.GetCharactersPerSecond(new Paragraph(p) { EndTime = newEndTime });
|
||||
if (charactersPerSecond <= Configuration.Settings.General.SubtitleMaximumCharactersPerSeconds)
|
||||
{
|
||||
@ -18588,7 +18588,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
SubtitleListview1.SetStartTimeAndDuration(index, _subtitle.Paragraphs[index], _subtitle.GetParagraphOrDefault(index + 1), _subtitle.GetParagraphOrDefault(index - 1));
|
||||
SetDurationInSeconds(_subtitle.Paragraphs[index].DurationTotalSeconds);
|
||||
InsertNewParagraphAtPosition(videoPositionMs);
|
||||
var newP = InsertNewParagraphAtPosition(newEndTime.TotalMilliseconds);
|
||||
if (audioVisualizer.WavePeaks != null && newP.EndTime.TotalSeconds >= audioVisualizer.EndPositionSeconds - 0.1)
|
||||
{
|
||||
audioVisualizer.StartPositionSeconds = Math.Max(0, newP.StartTime.TotalSeconds - 0.1);
|
||||
}
|
||||
|
||||
UpdateSourceView();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user