branchport r489480

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=489483
This commit is contained in:
Albert Astals Cid 2005-12-18 21:46:54 +00:00
parent 3dad5f6890
commit 9d2d7085f0

View file

@ -69,9 +69,16 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
else
{
// cropBox can not be bigger than mediaBox
if (cropBox.x2 - cropBox.x1 > mediaBox.x2 - mediaBox.x1 ||
cropBox.y2 - cropBox.y1 > mediaBox.y2 - mediaBox.y1)
cropBox = mediaBox;
if (cropBox.x2 - cropBox.x1 > mediaBox.x2 - mediaBox.x1)
{
cropBox.x1 = mediaBox.x1;
cropBox.x2 = mediaBox.x2;
}
if (cropBox.y2 - cropBox.y1 > mediaBox.y2 - mediaBox.y1)
{
cropBox.y1 = mediaBox.y1;
cropBox.y2 = mediaBox.y2;
}
}
// other boxes