From: sbarman Date: Tue, 14 Jun 2011 19:19:35 +0000 (-0700) Subject: cleaned up code X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=aa6d9f75a38996651f499362f67ce07110da80b5;p=pdf.js.git cleaned up code --- diff --git a/pdf.js b/pdf.js index 8733531..1910a21 100644 --- a/pdf.js +++ b/pdf.js @@ -1911,9 +1911,6 @@ var CanvasGraphics = (function() { // Shading shadingFill: function(entryRef) { - if (!this.current.bbox) - TODO("bbox"); - var shadingRes = this.res.get("Shading"); if (!shadingRes) return; @@ -1965,8 +1962,7 @@ var CanvasGraphics = (function() { fillAxialShading: function(sh) { var cds = sh.get("Coords"); - - + var t0 = 0.0, t1 = 1.0; if (sh.has("Domain")) { var domainArr = sh.get("Domain"); @@ -1981,8 +1977,10 @@ var CanvasGraphics = (function() { } var fnObj = sh.get("Function"); fnObj = this.xref.fetchIfRef(fnObj); - if (!IsFunction(fnObj)) - error("invalid function"); + if (IsArray(fnObj)) + error("No support for array of functions"); + else if (!IsFunction(fnObj)) + error("Invalid function"); fn = new Function(this.xref, fnObj); var gradient = this.ctx.createLinearGradient(cds[0], cds[1], cds[2], cds[3]);