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) {