Skip to content

Commit

Permalink
Minor fix for 1ms overlapping in export to images
Browse files Browse the repository at this point in the history
  • Loading branch information
niksedk committed Jul 13, 2014
1 parent 545d7aa commit 2e7cdf6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Forms/ExportPngXml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ private MakeBitmapParameter MakeMakeBitmapParameter(int index, int screenWidth,i

private void ButtonExportClick(object sender, EventArgs e)
{
FixStartEndWithSameTimeCode();

var errors = new List<string>();
buttonExport.Enabled = false;
SetupImageParameters();
Expand Down Expand Up @@ -717,6 +719,17 @@ private void ButtonExportClick(object sender, EventArgs e)
buttonExport.Enabled = true;
}

private void FixStartEndWithSameTimeCode()
{
for (int i = 0; i < _subtitle.Paragraphs.Count - 1; i++)
{
Paragraph p = _subtitle.Paragraphs[i];
Paragraph next = _subtitle.Paragraphs[i + 1];
if (p.EndTime.TotalMilliseconds == next.StartTime.TotalMilliseconds)
p.EndTime.TotalMilliseconds--;
}
}

private void SetResolution(string xAndY)
{
if (string.IsNullOrEmpty(xAndY))
Expand Down

0 comments on commit 2e7cdf6

Please sign in to comment.