]> git.parisson.com Git - pdf.js.git/commitdiff
Merge branch 'master' of git://github.com/mozilla/pdf.js into text-select
authorArtur Adib <arturadib@gmail.com>
Mon, 28 Nov 2011 15:02:07 +0000 (10:02 -0500)
committerArtur Adib <arturadib@gmail.com>
Mon, 28 Nov 2011 15:02:07 +0000 (10:02 -0500)
Conflicts:
src/canvas.js
web/viewer.js

1  2 
src/canvas.js
src/core.js
web/viewer.js

diff --cc src/canvas.js
index ab1422758394927d881c7eb25eeda8424f6002d6,c1d2785e871176a9f4d8b127b6040668baa3dbbf..bf09e802abf4c77329fb6be4e093b468ca856e74
@@@ -64,11 -174,7 +174,7 @@@ var CanvasGraphics = (function canvasGr
    // before it stops and shedules a continue of execution.
    var kExecutionTime = 50;
  
-   // Number of IR commands to execute before checking
-   // if we execute longer then `kExecutionTime`.
-   var kExecutionTimeCheck = 500;
 -  function constructor(canvasCtx, objs) {
 +  function constructor(canvasCtx, objs, textLayer) {
      this.ctx = canvasCtx;
      this.current = new CanvasExtraState();
      this.stateStack = [];
      this.xobjs = null;
      this.ScratchCanvas = ScratchCanvas;
      this.objs = objs;
 -
 +    this.textLayer = textLayer;
+     if (canvasCtx) {
+       addContextCurrentTransform(canvasCtx);
+     }
    }
  
    var LINE_CAP_STYLES = ['butt', 'round', 'square'];
diff --cc src/core.js
Simple merge
diff --cc web/viewer.js
index f7821659e58234a1d5e302cf60449ced5708aa24,c8b8304315294f2342a73ba962c164ca2d0851cf..196d16af407502e0868af2eaec9f7e7cc4e87a8e
@@@ -474,11 -487,8 +487,12 @@@ var PageView = function pageView(contai
      canvas.id = 'page' + this.id;
      canvas.mozOpaque = true;
      div.appendChild(canvas);
+     this.canvas = canvas;
  
 +    var textLayer = document.createElement('div');
 +    textLayer.className = 'textLayer';
 +    div.appendChild(textLayer);
 +
      var scale = this.scale;
      canvas.width = pageWidth * scale;
      canvas.height = pageHeight * scale;
      ctx.translate(-this.x * scale, -this.y * scale);
  
      stats.begin = Date.now();
-     this.content.startRendering(ctx, this.updateStats, textLayer);
+     this.content.startRendering(ctx, (function pageViewDrawCallback() {
+       this.updateStats();
+       if (this.onAfterDraw)
+         this.onAfterDraw();
 -    }).bind(this));
++    }).bind(this), textLayer);
  
      setupLinks(this.content, this.scale);
      div.setAttribute('data-loaded', true);