From 2b4941767318c1aa964102ffb54a49d4759af0e7 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 23 Oct 2013 16:06:46 +0000 Subject: [PATCH] AER table location improvements --- PROMS/Volian.Print.Library/vlnParagraph.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index e09053bd..996ffd18 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1878,8 +1878,10 @@ namespace Volian.Print.Library // if in rno column, the upper limit is width of the page (right margin). Subtract off size of a character xUpperLimit = pageWidth - (72 / (float)MyItemInfo.FormatStepData.Font.CPI); else + // in the following calculation, the hls width (hls1.Width) == rno column width, so xUpperLimit is + // the around the right margin, i.e. 'hls xoffset' + 'location of rno (colR) * columnmode' + 'width of rno' xUpperLimit = hls1.XOffset + hls1.Width + colR * itemInfo.ColumnMode; - + float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]); if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2; @@ -1915,8 +1917,15 @@ namespace Volian.Print.Library } // 05/14/12 - The PosAdjust is a format flag from 16bit. For WCN2, it appears that this amount equals // the amount of difference from a 10 CPI to a 12 CPI font. See comment above. - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) - XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); + float posAdjust = (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); + if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null && + posAdjust > 0) + { + if (Width < hls1.Width - posAdjust) + XOffset += posAdjust; + else if (Width < hls1.Width) + XOffset = hls1.XOffset + hls1.Width - Width; // align with the right edge of hls text + } } // if the XOffset < High Level Step Text's XOffset, then align with the High Level Step Text