Browse Source

Fixing CropBox

notmasteryet 14 years ago
parent
commit
6672420f8d
  1. 6
      src/core.js

6
src/core.js

@ -110,9 +110,11 @@ var Page = (function PageClosure() {
width: this.width, width: this.width,
height: this.height height: this.height
}; };
var mediaBox = this.mediaBox;
var offsetX = mediaBox[0], offsetY = mediaBox[1];
if (isArray(obj) && obj.length == 4) { if (isArray(obj) && obj.length == 4) {
var tl = this.rotatePoint(obj[0], obj[1]); var tl = this.rotatePoint(obj[0] - offsetX, obj[1] - offsetY);
var br = this.rotatePoint(obj[2], obj[3]); var br = this.rotatePoint(obj[2] - offsetX, obj[3] - offsetY);
view.x = Math.min(tl.x, br.x); view.x = Math.min(tl.x, br.x);
view.y = Math.min(tl.y, br.y); view.y = Math.min(tl.y, br.y);
view.width = Math.abs(tl.x - br.x); view.width = Math.abs(tl.x - br.x);

Loading…
Cancel
Save