Minor fix for shadow preview in SSA/ASS properties

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2190 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-11-15 19:12:57 +00:00
parent 3c83500ef1
commit 72285a144e

View File

@ -210,6 +210,9 @@ namespace Nikse.SubtitleEdit.Forms
top = (bmp.Height - measuredHeight) / 2;
else
top = bmp.Height - measuredHeight - ((int)numericUpDownMarginVertical.Value);
top -= (int)numericUpDownShadowWidth.Value;
if (radioButtonTopCenter.Checked || radioButtonMiddleCenter.Checked || radioButtonBottomCenter.Checked)
left -= (int)(numericUpDownShadowWidth.Value / 2);
int leftMargin = 0;
int pathPointsStart = -1;
@ -229,14 +232,16 @@ namespace Nikse.SubtitleEdit.Forms
// draw shadow
if (numericUpDownShadowWidth.Value > 0 && radioButtonOutline.Checked)
{
var shadowPath = (GraphicsPath) path.Clone();
for (int i = 0; i < (int)numericUpDownShadowWidth.Value; i++)
{
var shadowPath = new GraphicsPath();
sb = new StringBuilder();
sb.Append("This is a test!");
int pathPointsStart2 = -1;
TextDraw.DrawText(font, sf, shadowPath, sb, checkBoxFontItalic.Checked, checkBoxFontBold.Checked, checkBoxFontUnderline.Checked, left + i + outline, top + i + outline, ref newLine, leftMargin, ref pathPointsStart2);
g.FillPath(new SolidBrush(Color.FromArgb(200, panelBackColor.BackColor)), shadowPath);
var translateMatrix = new Matrix();
translateMatrix.Translate(1, 1);
shadowPath.Transform(translateMatrix);
var p1 = new Pen(Color.FromArgb(250, panelBackColor.BackColor), outline);
g.DrawPath(p1, shadowPath);
p1.Dispose();
}
}