From ba5736d19ad8ee708c00421fd54d4bb598b358dd Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 28 Sep 2016 16:15:10 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20B2016-219:=20VC=20Summer=E2=80=99s=20cent?= =?UTF-8?q?erline=20prints=20on=20top=20of=20figure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Print.Library/vlnParagraph.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 758bf80f..f64b5692 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -527,7 +527,7 @@ namespace Volian.Print.Library { yLocation -= (SixLinesPerInch * MyPageHelper.YMultiplier); if (ImageText != null) - retval = DrawFigure(cb, yBottomMargin, yLocation); + retval = DrawFigure(cb, yBottomMargin, yLocation, yPageStart, yTopMargin); else retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); @@ -1204,7 +1204,7 @@ namespace Volian.Print.Library } } //private bool _TextDebug = false; //true; this will turn on a writeline with debug in DrawText() - private float DrawFigure(PdfContentByte cb, float yBottomMargin, float yLocation) + private float DrawFigure(PdfContentByte cb, float yBottomMargin, float yLocation, float yPageStart, float yTopMargin) { int profileDepth = ProfileTimer.Push("vlnParagraph.DrawFigure"); float retval = yLocation; @@ -1251,6 +1251,19 @@ namespace Volian.Print.Library } //iTextSharp.text.Image it_image = iTextSharp.text.Image.GetInstance(ROImageInfo.Decompress(roImage.Content, size)); retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); + + // The following code was added to fix B2016-219 (for VCS, the centerline drew through a figure). The 'top' value was taken from the code + // that draws the vlnBoxes (Caution/Note, etc) + // The adjustments, adjtop & adjbottom, were necessary to get the vertical centerline to meet up correctly with the top/bottom of the figure. These + // numbers were determined by trial and error. + float top = CalculateYOffset(yPageStart, yTopMargin) - (7 * MyPageHelper.YMultiplier); + float adjtop=0; + float adjbottom=0; + if (MyPageHelper.YMultiplier == 1) + adjtop = -3; + else + adjbottom = -1; + MyPageHelper.MyGaps.Add(new Gap(top + adjtop, top - Height - Rtf2Pdf.Offset.Y + adjbottom)); } } ProfileTimer.Pop(profileDepth);