From: sbarman Date: Sun, 19 Jun 2011 19:04:57 +0000 (-0700) Subject: Merge branch 'master' of github.com:andreasgal/pdf.js X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=8afd1a65ff1bb83fe22076f4be352c692a8e070a;p=pdf.js.git Merge branch 'master' of github.com:andreasgal/pdf.js --- 8afd1a65ff1bb83fe22076f4be352c692a8e070a diff --cc pdf.js index 4eff1f0,a051e57..7436b9a --- a/pdf.js +++ b/pdf.js @@@ -2400,13 -2531,9 +2531,13 @@@ var CanvasGraphics = (function() error("No support for array of functions"); else if (!IsPDFFunction(fnObj)) error("Invalid function"); - fn = new PDFFunction(this.xref, fnObj); + var fn = new PDFFunction(this.xref, fnObj); var gradient = this.ctx.createLinearGradient(x0, y0, x1, y1); + + // 10 samples seems good enough for now, but probably won't work + // if there are sharp color changes. Ideally, we could see the + // current image size and base the # samples on that. var step = (t1 - t0) / 10; for (var i = t0; i <= t1; i += step) {