From: Artur Adib Date: Mon, 28 Nov 2011 15:02:07 +0000 (-0500) Subject: Merge branch 'master' of git://github.com/mozilla/pdf.js into text-select X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4cfc5521639397c9bf84ee66c3e1234aa49608fc;p=pdf.js.git Merge branch 'master' of git://github.com/mozilla/pdf.js into text-select Conflicts: src/canvas.js web/viewer.js --- 4cfc5521639397c9bf84ee66c3e1234aa49608fc diff --cc src/canvas.js index ab14227,c1d2785..bf09e80 --- a/src/canvas.js +++ b/src/canvas.js @@@ -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 = []; @@@ -77,7 -183,10 +183,10 @@@ 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 web/viewer.js index f782165,c8b8304..196d16a --- a/web/viewer.js +++ b/web/viewer.js @@@ -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; @@@ -491,7 -501,11 +505,11 @@@ 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);