Use vlnParagraph for footnotes so that Change Bars will print (rather than vlnText)
Fixed change bar message writing on top of each other (for ‘ChangeIds’ change bar messages)
This commit is contained in:
@@ -165,11 +165,27 @@ namespace Volian.Print.Library
|
||||
cb.Stroke();
|
||||
DebugPdf(cb, XOffset + xAdj - 1.5F, YOffset - yAdj + 4);
|
||||
DebugPdf(cb, XOffset + xAdj - 1.5F, YChangeBarBottomExtend - yAdj - 1);
|
||||
|
||||
if (Messages != null)
|
||||
{
|
||||
// if doing messages at top, then remove duplicates if they are next to each other.
|
||||
// If this was not done, the location of messages was not correct.
|
||||
if (_MsgAtTop && Messages.Count > 1)
|
||||
{
|
||||
string lastNoDup = "";
|
||||
SortedDictionary<float, vlnChangeBarMessage> tmpNoDup = new SortedDictionary<float, vlnChangeBarMessage>();
|
||||
foreach (KeyValuePair<float, vlnChangeBarMessage> nodupM in Messages)
|
||||
{
|
||||
vlnChangeBarMessage noDupCmb = (vlnChangeBarMessage)nodupM.Value;
|
||||
if (lastNoDup != noDupCmb.Message) tmpNoDup.Add(nodupM.Key, noDupCmb);
|
||||
lastNoDup = noDupCmb.Message;
|
||||
}
|
||||
Messages = tmpNoDup;
|
||||
}
|
||||
// Loop through messages for this change bar. The first message is the bottom-most, which is always put out.
|
||||
// Working up, if the current message is the same as the one below it, don't put it out.
|
||||
string lastMsg = null;
|
||||
int incrementMsgAtTop = (Messages == null ? 0 : Messages.Count-1);
|
||||
foreach (KeyValuePair<float, vlnChangeBarMessage> kvp in Messages)
|
||||
{
|
||||
float yBottom = (float)System.Convert.ToDouble(kvp.Key);
|
||||
@@ -194,7 +210,11 @@ namespace Volian.Print.Library
|
||||
float h = GetParagraphHeight(cb, myparagraph, w);
|
||||
cb.SetColorFill(changeBarColor);
|
||||
float yloc = yBottom + h - Rtf2Pdf.Offset.Y + 2.7F;
|
||||
if (_MsgAtTop) yloc = YOffset;
|
||||
if (_MsgAtTop)
|
||||
{
|
||||
yloc = YOffset - ((incrementMsgAtTop * h)); // + 2);
|
||||
incrementMsgAtTop--;
|
||||
}
|
||||
Rtf2Pdf.TextAt(cb, myparagraph, XOffset + xAdj - Rtf2Pdf.Offset.X + 3, yloc, w, h, "", yBottomMargin);
|
||||
lastMsg = vcbm.Message;
|
||||
}
|
||||
|
Reference in New Issue
Block a user