fix this/self in sla setup

This commit is contained in:
Stewart Allen 2021-08-01 12:23:35 -04:00
commit 77a5da7645
3 changed files with 5 additions and 6 deletions

View file

@ -8,7 +8,7 @@ let BASE = self.base,
POLY = BASE.polygons, POLY = BASE.polygons,
time = UTIL.time, time = UTIL.time,
qtpi = Math.cos(Math.PI/4), qtpi = Math.cos(Math.PI/4),
ccvalue = navigator ? navigator.hardwareConcurrency || 0 : 0, ccvalue = this.navigator ? navigator.hardwareConcurrency || 0 : 0,
concurrent = self.Worker && ccvalue > 3 ? ccvalue - 1 : 0, concurrent = self.Worker && ccvalue > 3 ? ccvalue - 1 : 0,
current = self.worker = { current = self.worker = {
print: null, print: null,

View file

@ -411,9 +411,8 @@
// return { image, lines }; // return { image, lines };
} }
if (!this.navigator && this.process && this.process.env) { if (!self.navigator && self.process && self.process.env) {
let fs = require('fs'); let fs = require('fs');
let self = this;
eval(fs.readFileSync("src/add/class.js").toString()); eval(fs.readFileSync("src/add/class.js").toString());
let args = process.argv.slice(2); let args = process.argv.slice(2);
let file = args.shift(); let file = args.shift();
@ -426,7 +425,7 @@
layers5: cxdlp.layers.slice(0,5), layers5: cxdlp.layers.slice(0,5),
lines1: cxdlp.get_layer_lines(1) lines1: cxdlp.get_layer_lines(1)
}); });
} else if (this.navigator) { } else if (self.navigator) {
this.CXDLP = CXDLP; self.CXDLP = CXDLP;
} }
}()); }());

View file

@ -525,7 +525,7 @@
ctx.closePath(); ctx.closePath();
} }
this.photon = { self.photon = {
generatePhoton, generatePhoton,
generatePhotons, generatePhotons,
renderLayer, renderLayer,