B2015- 076: underlining overwrites text below (occurred on compressed steps with larger font)

This commit is contained in:
2015-06-22 14:42:46 +00:00
parent 7bc11c7fb6
commit a038fe06e9
3 changed files with 23 additions and 10 deletions

View File

@@ -560,6 +560,7 @@ namespace Volian.Print.Library
if (doprint)
{
int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DrawText");
IsCompressed = (MyPageHelper.YMultiplier != 1 && MyItemInfo != null && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Font.Size >= 12 && (MyItemInfo.FormatStepData.Font.Style & E_Style.Underline) != 0);
retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation);
// Wolf Creek Training format puts a separator line after printing the section number/title
if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining)
@@ -861,7 +862,6 @@ namespace Volian.Print.Library
private float DrawText(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation)
{
// KBR (6/17/15): Fix for underline location in compressed steps: PrintOverride.StepCompress = false;
if(DebugText.IsOpen)DebugText.WriteLine("{0},'{1}','{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText);
//Console.WriteLine("{0},{1},'{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content);
float retval = yLocation;
@@ -954,10 +954,7 @@ namespace Volian.Print.Library
//if (MyItemInfo.InList(39048)) Console.WriteLine("Here");
}
MyPageHelper.BottomContent = yLocation - (Height * MyPageHelper.YMultiplier);
// KBR (6/17/15): Fix for underline location in compressed steps:
// KBR (6/17/15): if (MyPageHelper.YMultiplier != 1) PrintOverride.StepCompress = true;
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo + string.Format(",YLines = {0}", YSize / SixLinesPerInch), yBottomMargin);
// KBR (6/17/15): PrintOverride.StepCompress = true;
ProfileTimer.Pop(profileDepth);
if (retval == 0) // problem occurred - paragraph was not able to be printed on page
{ // pagination logic needs to be fixed.