From 6345ed54e799fdd25a42287fafa602513f50bb1e Mon Sep 17 00:00:00 2001 From: niksedk Date: Sun, 11 Oct 2026 17:37:04 +0200 Subject: [PATCH] TypewriterEffect: no 1 ms gap between steps Each step ended 1 ms before the next one started, and the end-delay line started 1 ms after the last step. During each gap nothing is on screen, so the text flickered, and a Blu-ray sup exported with "Full frame image" let the video show through (SubtitleEdit/subtitleedit#15933). Each step now ends where the next one starts. Co-Authored-By: Claude Opus 5.5 --- se5/TypewriterEffect/TypewriterEngine.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/se5/TypewriterEffect/TypewriterEngine.cs b/se5/TypewriterEffect/TypewriterEngine.cs index 6f656e03..409f45c7 100644 --- a/se5/TypewriterEffect/TypewriterEngine.cs +++ b/se5/TypewriterEffect/TypewriterEngine.cs @@ -145,8 +145,11 @@ private static List GenerateForParagraph(SrtBlock p, double endDelaySe text += tag + p.Text[i]; tag = string.Empty; + // Each step ends where the next one starts: a gap, even 1 ms, shows no text for + // that moment, so the line flickers (and a full-frame Blu-ray sup image lets the + // video show through). var startMs = p.StartMs + (long)(index * stepMs); - var endMs = p.StartMs + (long)((index + 1) * stepMs) - 1; + var endMs = p.StartMs + (long)((index + 1) * stepMs); if (endMs < startMs) { endMs = startMs; @@ -165,7 +168,7 @@ private static List GenerateForParagraph(SrtBlock p, double endDelaySe if (endDelayMs > 0 && result.Count > 0) { - var startMs = p.StartMs + workDurationMs; + var startMs = result[^1].EndMs; result.Add(new SrtBlock { StartMs = startMs, EndMs = p.EndMs, Text = p.Text }); } else if (result.Count > 0)