Fixed bug in image export - thx marb99 :)

Fix #2187
This commit is contained in:
Nikolaj Olsson 2017-01-22 11:52:36 +01:00
parent 7ade1053b0
commit eb814ea20a
2 changed files with 26 additions and 54 deletions

View File

@ -9,6 +9,7 @@
* Added shortcut "Go to previous line and set video position" - thx Mia
* IMPROVED:
* Updated Russian translation - thx Elheym
* Updated Portuguese translation - thx moob
* Minor improvements for format "Structured titles" - thx Yamato-ua
* List view columns arrangable and non-clickable - thx Ingo
* FIXED:
@ -18,6 +19,7 @@
* Fix for MPC-HC 32-bit - thx ZoneX
* Fixed issue with importing "Unknown 53" format - thx darnn
* Fixed italic rendering issue in format DCinema SMPTE - thx Miga
* Fixed bug in image export - thx marb99
3.5.1 (13th December 2016)

View File

@ -1951,15 +1951,8 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
lastText.Append(sb);
TextDraw.DrawText(font, sf, path, sb, isItalic, parameter.SubtitleFontBold, false, left, top, ref newLine, leftMargin, ref newLinePathPoint);
}
if (path.PointCount > 0)
{
var list = (PointF[])path.PathPoints.Clone(); // avoid using very slow path.PathPoints indexer!!!
for (int k = oldPathPointIndex; k < list.Length; k++)
{
if (list[k].X > addLeft)
addLeft = list[k].X;
}
}
addLeft = GetLastPositionFromPath(path, oldPathPointIndex, addLeft);
if (path.PointCount == 0)
addLeft = left;
else if (addLeft < 0.01)
@ -2068,15 +2061,8 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
TextDraw.DrawText(font, sf, path, sb, isItalic, parameter.SubtitleFontBold, false, left, top, ref newLine, leftMargin, ref newLinePathPoint);
}
if (path.PointCount > 0)
{
var list = (PointF[])path.PathPoints.Clone(); // avoid using very slow path.PathPoints indexer!!!
for (int k = oldPathPointIndex; k < list.Length; k++)
{
if (list[k].X > addLeft)
addLeft = list[k].X;
}
}
addLeft = GetLastPositionFromPath(path, oldPathPointIndex, addLeft);
if (addLeft < 0.01)
addLeft = left + 2;
left = addLeft;
@ -2563,15 +2549,8 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
lastText.Append(sb);
TextDraw.DrawText(font, sf, path, sb, isItalic, isBold || parameter.SubtitleFontBold, false, left, top, ref newLine, leftMargin, ref newLinePathPoint);
}
if (path.PointCount > 0)
{
var list = (PointF[])path.PathPoints.Clone(); // avoid using very slow path.PathPoints indexer!!!
for (int k = oldPathPointIndex; k < list.Length; k++)
{
if (list[k].X > addLeft)
addLeft = list[k].X;
}
}
addLeft = GetLastPositionFromPath(path, oldPathPointIndex, addLeft);
if (path.PointCount == 0)
addLeft = left;
else if (addLeft < 0.01)
@ -2682,15 +2661,8 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
TextDraw.DrawText(font, sf, path, sb, isItalic, isBold || parameter.SubtitleFontBold, false, left, top, ref newLine, leftMargin, ref newLinePathPoint);
}
if (path.PointCount > 0)
{
var list = (PointF[])path.PathPoints.Clone(); // avoid using very slow path.PathPoints indexer!!!
for (int k = oldPathPointIndex; k < list.Length; k++)
{
if (list[k].X > addLeft)
addLeft = list[k].X;
}
}
addLeft = GetLastPositionFromPath(path, oldPathPointIndex, addLeft);
if (addLeft < 0.01)
addLeft = left + 2;
left = addLeft;
@ -2745,15 +2717,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
TextDraw.DrawText(font, sf, path, sb, isItalic, isBold || parameter.SubtitleFontBold, false, left, top, ref newLine, leftMargin, ref newLinePathPoint);
}
if (path.PointCount > 0)
{
var list = (PointF[])path.PathPoints.Clone(); // avoid using very slow path.PathPoints indexer!!!
for (int k = oldPathPointIndex; k < list.Length; k++)
{
if (list[k].X > addLeft)
addLeft = list[k].X;
}
}
addLeft = GetLastPositionFromPath(path, oldPathPointIndex, addLeft);
if (addLeft < 0.01)
addLeft = left + 2;
left = addLeft;
@ -2797,15 +2761,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
TextDraw.DrawText(font, sf, path, sb, isItalic, isBold, false, left, top, ref newLine, leftMargin, ref newLinePathPoint);
}
if (path.PointCount > 0)
{
var list = (PointF[])path.PathPoints.Clone(); // avoid using very slow path.PathPoints indexer!!!
for (int k = oldPathPointIndex; k < list.Length; k++)
{
if (list[k].X > addLeft)
addLeft = list[k].X;
}
}
addLeft = GetLastPositionFromPath(path, oldPathPointIndex, addLeft);
if (addLeft < 0.01)
addLeft = left + 2;
left = addLeft;
@ -2908,6 +2864,20 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
}
}
private static float GetLastPositionFromPath(GraphicsPath path, int oldPathPointIndex, float addLeft)
{
if (path.PointCount > 0)
{
var list = (PointF[])path.PathPoints.Clone(); // avoid using very slow path.PathPoints indexer!!!
for (int k = oldPathPointIndex + 1; k < list.Length; k++)
{
if (list[k].X > addLeft)
addLeft = list[k].X;
}
}
return addLeft;
}
private static Point? GetAssPoint(string s)
{
int k = s.IndexOf("{\\", StringComparison.Ordinal);