Merge pull request #4192 from yurydelendik/shading-r

Implements shading types 4-7
This commit is contained in:
Brendan Dahl 2014-01-30 13:36:01 -08:00
commit 1e4d35c3a0
6 changed files with 3639 additions and 9 deletions

View file

@ -671,10 +671,12 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}
var transform = viewport.transform;
this.baseTransform = transform.slice();
this.ctx.save();
this.ctx.transform.apply(this.ctx, transform);
this.baseTransform = this.ctx.mozCurrentTransform.slice();
if (this.textLayer) {
this.textLayer.beginLayout();
}
@ -1550,10 +1552,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}
var pattern = new TilingPattern(IR, color, this.ctx, this.objs,
this.commonObjs, this.baseTransform);
} else if (IR[0] == 'RadialAxial' || IR[0] == 'Dummy') {
var pattern = getShadingPatternFromIR(IR);
} else {
error('Unkown IR type ' + IR[0]);
var pattern = getShadingPatternFromIR(IR);
}
return pattern;
},
@ -1634,7 +1634,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.save();
var pattern = getShadingPatternFromIR(patternIR);
ctx.fillStyle = pattern.getPattern(ctx, this);
ctx.fillStyle = pattern.getPattern(ctx, this, true);
var inv = ctx.mozCurrentTransformInverse;
if (inv) {