Fixed Logic to limit size of figures to use the whole page and keep the the same aspect ratio.

This commit is contained in:
Rich 2014-11-10 18:23:44 +00:00
parent a711691ff6
commit 3237a2345b

View File

@ -2095,7 +2095,7 @@ namespace Volian.Print.Library
{ {
get get
{ {
return (float)(MyItemInfo.MyDocStyle.Layout.PageLength - MyItemInfo.MyDocStyle.Layout.TopMargin - MyItemInfo.MyDocStyle.Layout.FooterLength); return (float)(MyItemInfo.MyDocStyle.Layout.PageLength /*- MyItemInfo.MyDocStyle.Layout.TopMargin*/ - MyItemInfo.MyDocStyle.Layout.FooterLength);
} }
} }
public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent, bool loadChildren, PromsPrinter pp) public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent, bool loadChildren, PromsPrinter pp)
@ -2608,7 +2608,13 @@ namespace Volian.Print.Library
// Check that the Height of figure isn't too big to fit on the page, if it is // Check that the Height of figure isn't too big to fit on the page, if it is
// set the Height to the printable part of page - Height of the HLS and an extra line // set the Height to the printable part of page - Height of the HLS and an extra line
// for between HLS & figure. // for between HLS & figure.
Height = Math.Min(lines * SixLinesPerInch, RoughSizeOfPage - MyParent.Height - SixLinesPerInch); float h1 = lines * SixLinesPerInch;
float h2 = RoughSizeOfPage - MyParent.Height - SixLinesPerInch;
Height = Math.Min(h1,h2);
if (h1 > h2)
{
Width *= (h2/h1);
}
//yForCheckoff = yoff + Height - SixLinesPerInch; //yForCheckoff = yoff + Height - SixLinesPerInch;
if (dropCheckoff) if (dropCheckoff)
yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text