1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Pass commonObjs to TilingPattern constructor

Broken example: http://www.eiken.or.jp/eiken/apply/private/flow/pdf/ichiji.pdf
This commit is contained in:
vyv03354 2013-03-03 21:36:44 +09:00
parent 32938d3a66
commit 9310e852db
4 changed files with 12 additions and 3 deletions

View file

@ -1153,7 +1153,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
color = base.getRgb(args, 0);
}
var pattern = new TilingPattern(IR, color, this.ctx, this.objs);
var pattern = new TilingPattern(IR, color, this.ctx, this.objs,
this.commonObjs);
} else if (IR[0] == 'RadialAxial' || IR[0] == 'Dummy') {
var pattern = Pattern.shadingFromIR(IR);
} else {

View file

@ -270,7 +270,7 @@ var TilingPattern = (function TilingPatternClosure() {
};
var MAX_PATTERN_SIZE = 4096;
function TilingPattern(IR, color, ctx, objs) {
function TilingPattern(IR, color, ctx, objs, commonObjs) {
var operatorList = IR[2];
this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];
var bbox = IR[4];
@ -314,7 +314,7 @@ var TilingPattern = (function TilingPatternClosure() {
// set the new canvas element context as the graphics context
var tmpCtx = tmpCanvas.getContext('2d');
var graphics = new CanvasGraphics(tmpCtx, null, objs);
var graphics = new CanvasGraphics(tmpCtx, commonObjs, objs);
this.setFillAndStrokeStyleToContext(tmpCtx, paintType, color);