]> git.parisson.com Git - pdf.js.git/commitdiff
Fixing zoom and rotate issues
authorYury Delendik <ydelendik@mozilla.com>
Wed, 11 Apr 2012 16:42:41 +0000 (09:42 -0700)
committerYury Delendik <ydelendik@mozilla.com>
Wed, 11 Apr 2012 16:42:41 +0000 (09:42 -0700)
src/api.js
web/viewer.js

index 3d97f53c9fb69ef4a5a09c3694cdc46a619ad4ea..cccd4b15278337d4ee920eba73ccedd03b3898a6 100644 (file)
@@ -19,7 +19,7 @@
       return this.page.view;
     },
     getViewport: function(scale, rotate) {
-      if (arguments < 2)
+      if (arguments.length < 2)
         rotate = this.rotate;
       return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0);
     },
index 9fe9a1714981aa5c3d16295743f8fe2b142658fb..3c7279fb4895a56878c7664593bd393f17d57684 100644 (file)
@@ -747,8 +747,6 @@ var PageView = function pageView(container, pdfPage, id, scale,
     var viewport = this.pdfPage.getViewport(this.scale);
 
     this.viewport = viewport;
-    this.width = viewport.width;
-    this.height = viewport.height;
     div.style.width = viewport.width + 'px';
     div.style.height = viewport.height + 'px';
 
@@ -763,6 +761,20 @@ var PageView = function pageView(container, pdfPage, id, scale,
     div.appendChild(this.loadingIconDiv);
   };
 
+  Object.defineProperty(this, 'width', {
+    get: function PageView_getWidth() {
+      return this.viewport.width;
+    },
+    enumerable: true
+  });
+
+  Object.defineProperty(this, 'height', {
+    get: function PageView_getHeight() {
+      return this.viewport.height;
+    },
+    enumerable: true
+  });
+
   function setupAnnotations(pdfPage, viewport) {
     function bindLink(link, dest) {
       link.href = PDFView.getDestinationHash(dest);