Working on fixing ebu justification, so option from save dialog is actually working... #1833

This commit is contained in:
Nikolaj Olsson 2016-07-07 18:21:03 +02:00
parent 0abd1268d9
commit a48d4f91a0
2 changed files with 8 additions and 3 deletions

View File

@ -602,7 +602,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
tti.VerticalPosition = (byte)startRow; // bottom (vertical)
}
tti.JustificationCode = EbuUiHelper.JustificationCode;
tti.JustificationCode = EbuUiHelper.JustificationCode; // use default justification
if (p.Text.StartsWith("{\\an1}", StringComparison.Ordinal) || p.Text.StartsWith("{\\an4}", StringComparison.Ordinal) || p.Text.StartsWith("{\\an7}", StringComparison.Ordinal))
{
tti.JustificationCode = 1; // 01h=left-justified text
@ -611,7 +611,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
{
tti.JustificationCode = 3; // 03h=right-justified
}
else // If it's not left- or right-justified, it's centred.
else if (p.Text.StartsWith("{\\an2}", StringComparison.Ordinal) || p.Text.StartsWith("{\\an5}", StringComparison.Ordinal) || p.Text.StartsWith("{\\an8}", StringComparison.Ordinal))
{
tti.JustificationCode = 2; // 02h=centred text
}

View File

@ -26,7 +26,12 @@ namespace Nikse.SubtitleEdit.Logic
using (var saveOptions = new EbuSaveOptions())
{
saveOptions.Initialize(_header, _justificationCode, _fileName, _subtitle);
return saveOptions.ShowDialog() == DialogResult.OK;
if (saveOptions.ShowDialog() == DialogResult.OK)
{
_justificationCode = saveOptions.JustificationCode;
return true;
}
return false;
}
}