Browse Source

Pass commonObjs to TilingPattern constructor

Broken example: http://www.eiken.or.jp/eiken/apply/private/flow/pdf/ichiji.pdf
vyv03354 12 years ago
parent
commit
9310e852db
  1. 3
      src/canvas.js
  2. 4
      src/pattern.js
  3. 1
      test/pdfs/ichiji.pdf.link
  4. 7
      test/test_manifest.json

3
src/canvas.js

@ -1153,7 +1153,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { @@ -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 {

4
src/pattern.js

@ -270,7 +270,7 @@ var TilingPattern = (function TilingPatternClosure() { @@ -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() { @@ -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);

1
test/pdfs/ichiji.pdf.link

@ -0,0 +1 @@ @@ -0,0 +1 @@
http://www.eiken.or.jp/eiken/apply/private/flow/pdf/ichiji.pdf

7
test/test_manifest.json

@ -612,6 +612,13 @@ @@ -612,6 +612,13 @@
"link": true,
"type": "eq"
},
{ "id": "ichiji",
"file": "pdfs/ichiji.pdf",
"md5": "66b645802d33513cd598886e017392b8",
"rounds": 1,
"link": true,
"type": "eq"
},
{ "id": "issue1350",
"file": "pdfs/issue1350.pdf",
"md5": "92f72a04a4d9d05b2dd433b51f32ab1f",

Loading…
Cancel
Save