]> git.parisson.com Git - pdf.js.git/commitdiff
Fix lint, remove for old worker code, fix some small stuff
authorJulian Viereck <julian.viereck@gmail.com>
Tue, 11 Oct 2011 18:32:16 +0000 (20:32 +0200)
committerJulian Viereck <julian.viereck@gmail.com>
Tue, 11 Oct 2011 20:09:17 +0000 (22:09 +0200)
pdf.js
web/viewer.js

diff --git a/pdf.js b/pdf.js
index 4c2b19b219f36512aa1db81c4a92cecf29d0d27f..b46fe3c29763cc7bb8d63d6f708f5f2f1a918005 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -3580,9 +3580,11 @@ var Page = (function pagePage() {
         content = new StreamsSequenceStream(content);
       }
 
-      var pe = this.pe = new PartialEvaluator(xref, handler, 'p' + this.pageNumber + '_');
+      var pe = this.pe = new PartialEvaluator(
+                                xref, handler, 'p' + this.pageNumber + '_');
       var IRQueue = {};
-      return this.IRQueue = pe.getIRQueue(content, resources, IRQueue, dependency);
+      return this.IRQueue = pe.getIRQueue(
+                                content, resources, IRQueue, dependency);
     },
 
     ensureFonts: function(fonts, callback) {
@@ -4593,7 +4595,7 @@ var PartialEvaluator = (function partialEvaluator() {
             if (font.translated) {
               // keep track of each font we translated so the caller can
               // load them asynchronously before calling display on a page
-              loadedName = 'font_' + uniquePrefix + ++this.objIdCounter;
+              loadedName = 'font_' + uniquePrefix + ++self.objIdCounter;
               font.translated.properties.loadedName = loadedName;
               font.loadedName = loadedName;
 
@@ -5544,9 +5546,6 @@ var CanvasGraphics = (function canvasGraphics() {
     },
     save: function canvasGraphicsSave() {
       this.ctx.save();
-      if (this.ctx.$saveCurrentX) {
-        this.ctx.$saveCurrentX();
-      }
       var old = this.current;
       this.stateStack.push(old);
       this.current = old.clone();
@@ -5554,9 +5553,6 @@ var CanvasGraphics = (function canvasGraphics() {
     restore: function canvasGraphicsRestore() {
       var prev = this.stateStack.pop();
       if (prev) {
-        if (this.ctx.$restoreCurrentX) {
-          this.ctx.$restoreCurrentX();
-        }
         this.current = prev;
         this.ctx.restore();
       }
@@ -5686,9 +5682,6 @@ var CanvasGraphics = (function canvasGraphics() {
     // Text
     beginText: function canvasGraphicsBeginText() {
       this.current.textMatrix = IDENTITY_MATRIX;
-      if (this.ctx.$setCurrentX) {
-        this.ctx.$setCurrentX(0);
-      }
       this.current.x = this.current.lineX = 0;
       this.current.y = this.current.lineY = 0;
     },
@@ -5721,18 +5714,14 @@ var CanvasGraphics = (function canvasGraphics() {
       this.current.fontSize = size;
 
       var name = fontObj.loadedName || 'sans-serif';
-      if (this.ctx.$setFont) {
-        this.ctx.$setFont(name, size);
-      } else {
-        var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') :
-                                   (fontObj.bold ? 'bold' : 'normal');
+      var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') :
+                                 (fontObj.bold ? 'bold' : 'normal');
 
-        var italic = fontObj.italic ? 'italic' : 'normal';
-        var serif = fontObj.serif ? 'serif' : 'sans-serif';
-        var typeface = '"' + name + '", ' + serif;
-        var rule = italic + ' ' + bold + ' ' + size + 'px ' + typeface;
-        this.ctx.font = rule;
-      }
+      var italic = fontObj.italic ? 'italic' : 'normal';
+      var serif = fontObj.serif ? 'serif' : 'sans-serif';
+      var typeface = '"' + name + '", ' + serif;
+      var rule = italic + ' ' + bold + ' ' + size + 'px ' + typeface;
+      this.ctx.font = rule;
     },
     setTextRenderingMode: function canvasGraphicsSetTextRenderingMode(mode) {
       TODO('text rendering mode: ' + mode);
@@ -5743,9 +5732,6 @@ var CanvasGraphics = (function canvasGraphics() {
     moveText: function canvasGraphicsMoveText(x, y) {
       this.current.x = this.current.lineX += x;
       this.current.y = this.current.lineY += y;
-      if (this.ctx.$setCurrentX) {
-        this.ctx.$setCurrentX(this.current.x);
-      }
     },
     setLeadingMoveText: function canvasGraphicsSetLeadingMoveText(x, y) {
       this.setLeading(-y);
@@ -5754,9 +5740,6 @@ var CanvasGraphics = (function canvasGraphics() {
     setTextMatrix: function canvasGraphicsSetTextMatrix(a, b, c, d, e, f) {
       this.current.textMatrix = [a, b, c, d, e, f];
 
-      if (this.ctx.$setCurrentX) {
-        this.ctx.$setCurrentX(0);
-      }
       this.current.x = this.current.lineX = 0;
       this.current.y = this.current.lineY = 0;
     },
@@ -5845,11 +5828,7 @@ var CanvasGraphics = (function canvasGraphics() {
       for (var i = 0; i < arrLength; ++i) {
         var e = arr[i];
         if (isNum(e)) {
-          if (ctx.$addCurrentX) {
-            ctx.$addCurrentX(-e * 0.001 * fontSize);
-          } else {
-            current.x -= e * 0.001 * fontSize * textHScale;
-          }
+          current.x -= e * 0.001 * fontSize * textHScale;
         } else if (isString(e)) {
           this.showText(e);
         } else {
index 81ca523361d0ecd6f0cec5d980e8ee8043beefcf..93f6acd315051573e1faa2e7a612aba64ee7cf57 100644 (file)
@@ -1,4 +1,4 @@
-ewer/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
 
 'use strict';