// 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'];
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);