From 83d746edfd3333a61fd261378e8e70af00d91c8a Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 8 Jun 2017 15:49:14 +0000 Subject: [PATCH] B2017-112: Figures in Supplemental Information pages overlap text if text font is shrunk --- PROMS/Volian.Print.Library/PromsPrinter.cs | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index e2f9cdab..55aff26b 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -1845,22 +1845,26 @@ namespace Volian.Print.Library { float hBefore = pg.Height;// Save initial paragraph height AdjustSupInfoTable(pg, scaler,cb); - 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. + if (pg.ImageText == null) { - if (!_AdjustForParagraphShrinkage.ContainsKey(pg.YOffset)) - _AdjustForParagraphShrinkage.Add(pg.YOffset, hleading - hAfter); + 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)) + { + if (!_AdjustForParagraphShrinkage.ContainsKey(pg.YOffset)) + _AdjustForParagraphShrinkage.Add(pg.YOffset, hleading - hAfter); + } + 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 } - 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