]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/Page.cc
Compiles at least :)
[evince.git] / pdf / xpdf / Page.cc
index d09170a82a4f674ec62b3dd32bacbe262534575c..7a5ee4bb1bd3daf0caa136f2c47bc85611196f0e 100644 (file)
@@ -97,23 +97,20 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
     if (obj2.isNum())
       cropY2 = obj2.getNum();
     obj2.free();
-
-    // if the MediaBox is excessively larger than the CropBox,
-    // just use the CropBox
-    w = 0.25 * (cropX2 - cropX1);
-    h = 0.25 * (cropY2 - cropY1);
-    if (cropX1 - x1 > w || x2 - cropX2 > w ||
-       cropY1 - y1 > h || y2 - cropY2 > h) {
-      x1 = cropX1;
-      x2 = cropX2;
-      y1 = cropY1;
-      y2 = cropY2;
-    }
-  } else {
-    cropX1 = cropX2 = cropY1 = cropY2 = 0;
   }
   obj1.free();
 
+  // if the MediaBox is excessively larger than the CropBox,
+  // just use the CropBox
+  limitToCropBox = gFalse;
+  w = 0.25 * (cropX2 - cropX1);
+  h = 0.25 * (cropY2 - cropY1);
+  if (cropX2 > cropX1 &&
+      (cropX1 - x1 > w || x2 - cropX2 > w ||
+       cropY1 - y1 > h || y2 - cropY2 > h)) {
+    limitToCropBox = gTrue;
+  }
+
   // rotate
   dict->lookup("Rotate", &obj1);
   if (obj1.isInt())