Improve pagination so that if steps at lower level have same y-offset as parent, break at parent (recursively until HLS)
This commit is contained in:
parent
74f88b6c1c
commit
0b53f7ec7e
@ -681,7 +681,7 @@ namespace Volian.Print.Library
|
||||
float spaceOnPage = yUpperLimit + yLocation;
|
||||
vlnParagraph myPara = myList[stepLevel][yLocation];
|
||||
int maxLev = stepLevel;
|
||||
if (spaceOnPage > 0 && (maxLev = MaxBreakLevel(yLocation, myList, stepLevel)) > stepLevel)
|
||||
if (spaceOnPage > 0 && (maxLev = MaxBreakLevel(yLocation, myList, stepLevel, myPara)) > stepLevel)
|
||||
{
|
||||
//DebugPagination.WriteLine("'Adjust for Max StepLevel',{0},{1},{2},'{3}'",myPara.MyItemInfo.ItemID,stepLevel,maxLev, myPara.MyItemInfo.ShortPath);
|
||||
//break;
|
||||
@ -759,7 +759,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
if (myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent;
|
||||
while (myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent;
|
||||
int everyNLines = myPara.MyItemInfo.MyPrevious != null && myPara.MyItemInfo.FormatStepData == null ? 1 : myPara.MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1;
|
||||
if (wcnChkLstBorder - yLocation < yUpperLimit + yAddForBtmMsg || (everyNLines != 99 && (wcnChkLstBorder - yLocation == yUpperLimit + yAddForBtmMsg))) // Fix for OFN-RJ-23
|
||||
//if (-yLocation < yUpperLimit) // Before
|
||||
@ -798,19 +798,26 @@ namespace Volian.Print.Library
|
||||
//if(minPara2 != null) DebugPagination.WriteLine("### n222222 {0}", minPara2);
|
||||
return minPara ?? minPara2;
|
||||
}
|
||||
private static int MaxBreakLevel(float yLocation, StepLevelList myList, int maxLevel)
|
||||
private static int MaxBreakLevel(float yLocation, StepLevelList myList, int maxLevel, vlnParagraph myParaBreak)
|
||||
{
|
||||
foreach (int stepLevel in myList.Keys)
|
||||
foreach (float yLoc in myList[stepLevel].Keys)
|
||||
if (yLocation == yLoc)
|
||||
if (stepLevel > maxLevel)
|
||||
{
|
||||
//vlnParagraph myPara = myList[stepLevel][yLoc];
|
||||
vlnParagraph myPara = myList[stepLevel][yLoc];
|
||||
//DebugPagination.WriteLine("'MaxBreakLevel',{0},{1},'{2}'", myPara.MyItemInfo.ItemID, stepLevel, myPara.MyItemInfo.ShortPath);
|
||||
maxLevel = stepLevel;
|
||||
if (!myPara.HasAncestor(myParaBreak))
|
||||
maxLevel = stepLevel;
|
||||
}
|
||||
return maxLevel;
|
||||
}
|
||||
private bool HasAncestor(vlnParagraph myParaBreak)
|
||||
{
|
||||
if (myParaBreak == MyParent) return true;
|
||||
if (MyParent == null || MyParent.MyItemInfo.IsHigh) return false;
|
||||
return MyParent.HasAncestor(myParaBreak);
|
||||
}
|
||||
//private void WalkStepLevel(float yTopMost)
|
||||
//{
|
||||
// foreach (vlnParagraph child in ChildrenAbove)
|
||||
|
Loading…
x
Reference in New Issue
Block a user