Added CenterToStepThenPage format flag which smothly transitions the left margin of a table as the table width increases from the high-level step width to the page width.
This commit is contained in:
@@ -4058,18 +4058,31 @@ namespace Volian.Print.Library
|
||||
XOffset = hls1.XOffset + hls1.Width - Width; // align with the right edge of hls text
|
||||
}
|
||||
}
|
||||
if (itemInfo.MyDocStyle.Layout.CenterToStepThenPage)
|
||||
{
|
||||
if (Width > hls1.Width)
|
||||
{
|
||||
float XOffsetPage = leftMargin + ((pageWidth - leftMargin) - Width) / 2;
|
||||
float fraction = (Width - hls1.Width) / ((pageWidth - leftMargin) - hls1.Width);
|
||||
float XOffsetNew = (1 - fraction) * XOffset + fraction * XOffsetPage;
|
||||
_MyLog.WarnFormat("***XOffsetAdjust-CenterToStepThenPage*** ItemID, XOffset, XOffsetPage, XOffsetNew ={0},{1},{2},{3}", itemInfo.ItemID, XOffset, XOffsetPage, XOffsetNew);
|
||||
XOffset = XOffsetNew;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if the XOffset < High Level Step Text's XOffset , then align with the High Level Step Text
|
||||
if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit))
|
||||
XOffset = xLowerLimit;
|
||||
|
||||
// if the XOffset < High Level Step Text's XOffset , then align with the High Level Step Text
|
||||
if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit))
|
||||
XOffset = xLowerLimit;
|
||||
// if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match.
|
||||
if (XOffset + Width > xUpperLimit)
|
||||
XOffset = xUpperLimit - Width;
|
||||
|
||||
// if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match.
|
||||
if (XOffset + Width > xUpperLimit)
|
||||
XOffset = xUpperLimit - Width;
|
||||
|
||||
// because of the above, if it pushes beyond the left margin, use the left margin.
|
||||
if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin)
|
||||
XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
||||
// because of the above, if it pushes beyond the left margin, use the left margin.
|
||||
if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin)
|
||||
XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
||||
}
|
||||
}
|
||||
private float AdjustForBlankLines()
|
||||
{
|
||||
|
Reference in New Issue
Block a user