mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Fixed possible crash in export of images (blank line) - thx Eros UK :)
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2058 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
38e82a335c
commit
cba3aac7c1
@ -1344,12 +1344,15 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
baseLinePadding = 12;
|
||||
if (parameter.SubtitleFontSize < 25)
|
||||
baseLinePadding = 9;
|
||||
if (lines[lines.Length - 1].Contains("g") || lines[lines.Length - 1].Contains("j") || lines[lines.Length - 1].Contains("p") || lines[lines.Length - 1].Contains("q") || lines[lines.Length - 1].Contains("y") || lines[lines.Length - 1].Contains(","))
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
string textNoBelow = lines[lines.Length - 1].Replace("g", "a").Replace("j", "a").Replace("p", "a").Replace("q", "a").Replace("y", "a").Replace(",", "a");
|
||||
baseLinePadding -= (int)Math.Round((TextDraw.MeasureTextHeight(font, lines[lines.Length - 1], parameter.SubtitleFontBold) - TextDraw.MeasureTextHeight(font, textNoBelow, parameter.SubtitleFontBold)));
|
||||
if (baseLinePadding < 0)
|
||||
baseLinePadding = 0;
|
||||
if (lines[lines.Length - 1].Contains("g") || lines[lines.Length - 1].Contains("j") || lines[lines.Length - 1].Contains("p") || lines[lines.Length - 1].Contains("q") || lines[lines.Length - 1].Contains("y") || lines[lines.Length - 1].Contains(","))
|
||||
{
|
||||
string textNoBelow = lines[lines.Length - 1].Replace("g", "a").Replace("j", "a").Replace("p", "a").Replace("q", "a").Replace("y", "a").Replace(",", "a");
|
||||
baseLinePadding -= (int)Math.Round((TextDraw.MeasureTextHeight(font, lines[lines.Length - 1], parameter.SubtitleFontBold) - TextDraw.MeasureTextHeight(font, textNoBelow, parameter.SubtitleFontBold)));
|
||||
if (baseLinePadding < 0)
|
||||
baseLinePadding = 0;
|
||||
}
|
||||
}
|
||||
|
||||
var lefts = new List<float>();
|
||||
|
Loading…
Reference in New Issue
Block a user