B2018-139 added checks for HLS, Cautions, Notes when processing Background text so that the left margin will be used in positioning the tab and text

This commit is contained in:
John Jenko 2018-10-31 14:39:32 +00:00
parent 456afbebf7
commit 98c04c8f0a

View File

@ -3354,7 +3354,8 @@ namespace Volian.Print.Library
// if this is a Note or Caution off of a Note or Caution (Catawba EG/1A/CSAM/SACGR1 step 1)
// then indent it the length of its tab
if (itemInfo.IsCaution || itemInfo.IsNote)
XOffset += (itemInfo.FormatStepData.TabData.IdentPrint.Length - 1) * 6;
XOffset += (!itemInfo.IsBackgroundStep()) ? (itemInfo.FormatStepData.TabData.IdentPrint.Length - 1) * 6 : 0; // B2018-139 don't adjust XOffset when processing a Caution, or Note background text is is off of Caution or Note WCN BG SAG-10 step 4
else
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null)
XOffset = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset);
@ -5679,9 +5680,15 @@ namespace Volian.Print.Library
int adj = 2;
if (myTab != null)
{
// F2018-041 seq tabs off of TitleWithTextBelow were running into the step text
myTab.XOffset = XOffset + (itemInfo.FormatStepData.Font.CharsToTwips * adj); // F2018-041 move tab over 2 chars so it positions like paragraphs under TitleWithTextBelow
adj += myTab.Text.Length; // F2018-041 add the length of the tab to the adjustment of the XOffset
//B2018-139 use XOffset when processing HLS, Caution, or Note background text and tab
if (itemInfo.IsHigh || (itemInfo.IsNote && (itemInfo.MyParent.IsHigh || itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote)) || (itemInfo.IsCaution && (itemInfo.MyParent.IsHigh || itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote)))
myTab.XOffset = XOffset;
else
{
// F2018-041 seq tabs off of TitleWithTextBelow were running into the step text
myTab.XOffset = XOffset + (itemInfo.FormatStepData.Font.CharsToTwips * adj); // F2018-041 move tab over 2 chars so it positions like paragraphs under TitleWithTextBelow
adj += myTab.Text.Length; // F2018-041 add the length of the tab to the adjustment of the XOffset
}
}
XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * adj); // indent 2 characters for background steps
Width -= (itemInfo.FormatStepData.Font.CharsToTwips * adj); // Adjust width by 2 characters