cleaned up code

This commit is contained in:
sbarman 2011-06-14 12:19:35 -07:00
parent de9150b528
commit 3c12d9ee31

12
pdf.js
View File

@ -1911,9 +1911,6 @@ var CanvasGraphics = (function() {
// Shading // Shading
shadingFill: function(entryRef) { shadingFill: function(entryRef) {
if (!this.current.bbox)
TODO("bbox");
var shadingRes = this.res.get("Shading"); var shadingRes = this.res.get("Shading");
if (!shadingRes) if (!shadingRes)
return; return;
@ -1965,8 +1962,7 @@ var CanvasGraphics = (function() {
fillAxialShading: function(sh) { fillAxialShading: function(sh) {
var cds = sh.get("Coords"); var cds = sh.get("Coords");
var t0 = 0.0, t1 = 1.0; var t0 = 0.0, t1 = 1.0;
if (sh.has("Domain")) { if (sh.has("Domain")) {
var domainArr = sh.get("Domain"); var domainArr = sh.get("Domain");
@ -1981,8 +1977,10 @@ var CanvasGraphics = (function() {
} }
var fnObj = sh.get("Function"); var fnObj = sh.get("Function");
fnObj = this.xref.fetchIfRef(fnObj); fnObj = this.xref.fetchIfRef(fnObj);
if (!IsFunction(fnObj)) if (IsArray(fnObj))
error("invalid function"); error("No support for array of functions");
else if (!IsFunction(fnObj))
error("Invalid function");
fn = new Function(this.xref, fnObj); fn = new Function(this.xref, fnObj);
var gradient = this.ctx.createLinearGradient(cds[0], cds[1], cds[2], cds[3]); var gradient = this.ctx.createLinearGradient(cds[0], cds[1], cds[2], cds[3]);