]> git.parisson.com Git - pdf.js.git/commitdiff
Fixing interpolation function (#549)
authornotmasteryet <async.processingjs@yahoo.com>
Tue, 11 Oct 2011 03:35:17 +0000 (22:35 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Tue, 11 Oct 2011 03:35:17 +0000 (22:35 -0500)
pdf.js

diff --git a/pdf.js b/pdf.js
index 847ed2ff48ddcaf2d8bb004619d5a2a05830a75a..79310b14959d1fc52fefc53c97c09df9f77cd3b0 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -6797,11 +6797,11 @@ var PDFFunction = (function pdfFunction() {
         diff.push(c1[i] - c0[i]);
 
       this.func = function pdfFunctionConstructInterpolatedFunc(args) {
-        var x = args[0];
+        var x = n == 1 ? args[0] : Math.pow(args[0], n);
 
         var out = [];
         for (var j = 0; j < length; ++j)
-          out.push(c0[j] + (x^n * diff[i]));
+          out.push(c0[j] + (x * diff[j]));
 
         return out;
       };