]> git.parisson.com Git - pdf.js.git/commitdiff
Fix width and height for pattering bounding box.
author= <=>
Wed, 5 Oct 2011 23:32:26 +0000 (16:32 -0700)
committer= <=>
Wed, 5 Oct 2011 23:32:26 +0000 (16:32 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index 36e572eb76e3be18655a0b8c3e3e8444e9dde86f..1d92d88a5d9f99e17807c68fb8ae130522bd48c9 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -6356,8 +6356,10 @@ var TilingPattern = (function tilingPattern() {
       graphics.transform.apply(graphics, tmpScale);
       graphics.transform.apply(graphics, tmpTranslate);
 
-      if (bbox && isArray(bbox) && 4 == bbox.length) {
-        graphics.rectangle(bbox[0], bbox[1], width, height);
+      if (bbox && isArray(bbox) && 4 == bbox.length) {        
+        var bboxWidth = bbox[2] - bbox[0];
+        var bboxHeight = bbox[3] - bbox[1];
+        graphics.rectangle(bbox[0], bbox[1], bboxWidth, bboxHeight);
         graphics.clip();
         graphics.endPath();
       }