B2017-012 Embedded Figure resizes on Facing Page

B2017-016 Equations and Visio Drawings resizes on Facing Page
Releated issue where Equipment Lists containing Embedded Figures, Equations and Visio Drawings were overlapping with procedure text.
Handle Embedded Figures, Equations and Visio Drawings when the Facing Page resize was occuring
Figures were not being handled properly for Facing Page font resize
This commit is contained in:
Rich
2017-06-12 12:56:18 +00:00
parent f4d9d38e59
commit 2aa7db1c76
3 changed files with 44 additions and 18 deletions

View File

@@ -1845,26 +1845,35 @@ namespace Volian.Print.Library
{
float hBefore = pg.Height;// Save initial paragraph height
AdjustSupInfoTable(pg, scaler,cb);
// B2017-112: Don't do the font size change if images.
if (pg.ImageText == null)
{
NewSupInfoFixChunks(pg, scaler);// Apply multiplier to font size
pg.IParagraph.Leading = scaler * pg.IParagraph.Leading; // Adjust leading (line spacing)
float hAfter = pg.GetParagraphHeight(cb, pg.IParagraph, "", pg.Width); // Calculate new paragraph height
pg.Height = hAfter; // Save new Height;
pg.YBottomMost += hAfter - hBefore; // Adjust YbottomMost for font size and leading
float hleading = hBefore * scaler; // Calcuate leading change
// If the change in font size effects the paragraph height due to word wrapping save the impact to adjust
// Offsets below
if ((hleading > hAfter + 1 && scaler < 1f) || (hleading < hAfter + 1 && scaler > 1f))
// B2017-112: Don't do the font size change if images.
// B2017-116: Don;t do the font size change for RTF Raw
if (pg.ImageText == null && !pg.MyItemInfo.IsRtfRaw)
{
if (!_AdjustForParagraphShrinkage.ContainsKey(pg.YOffset))
_AdjustForParagraphShrinkage.Add(pg.YOffset, hleading - hAfter);
float hAfter = pg.GetParagraphHeight(cb, pg.IParagraph, "", pg.Width); // Calculate new paragraph height
pg.Height = hAfter; // Save new Height;
pg.YBottomMost += hAfter - hBefore; // Adjust YbottomMost for font size and leading
float hleading = hBefore * scaler; // Calcuate leading change
// If the change in font size effects the paragraph height due to word wrapping save the impact to adjust
// Offsets below
if ((hleading > hAfter + 1 && scaler < 1f) || (hleading < hAfter + 1 && scaler > 1f))
{
if (!_AdjustForParagraphShrinkage.ContainsKey(pg.YOffset))
{
_AdjustForParagraphShrinkage.Add(pg.YOffset, hleading - hAfter);
}
}
}
else // Adjust the Image Size B2017-112 And B2017-116
{
pg.ImageScaler *= scaler;
pg.Height *= scaler;
pg.Width *= scaler;
}
float yoBefore = pg.YOffset;// Save the offset before
float yoAfter = pg.YOffset = NewSupInfoFixOffset(pg, scaler);// Calculate the offset after
pg.YBottomMost += yoAfter - yoBefore;// Adjust YbottomMost for changes to yOffset
}
foreach (vlnParagraph cpg in pg.ChildrenAbove)// Process Children Above
ReduceSupInfoGroupFontSize(cpg, scaler, cb);
foreach (vlnParagraph cpg in pg.ChildrenBelow)// Process Children Below