added worker control path option
This commit is contained in:
parent
5de8438968
commit
5485a7c700
1 changed files with 5 additions and 4 deletions
|
@ -21,17 +21,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Pixastic(ctx) {
|
function Pixastic(ctx, workerControlPath) {
|
||||||
|
|
||||||
var P = {},
|
var P = {},
|
||||||
width = ctx.canvas.width,
|
width = ctx.canvas.width,
|
||||||
height = ctx.canvas.height,
|
height = ctx.canvas.height,
|
||||||
queue = [];
|
queue = [],
|
||||||
|
workerControlPath = workerControlPath || "";
|
||||||
|
|
||||||
if (!worker) {
|
if (!worker) {
|
||||||
if (typeof window.Worker != "undefined") {
|
if (typeof window.Worker != "undefined") {
|
||||||
try {
|
try {
|
||||||
worker = new window.Worker("pixastic.worker.control.js");
|
worker = new window.Worker(workerControlPath + "pixastic.worker.control.js");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (location.protocol == "file:") {
|
if (location.protocol == "file:") {
|
||||||
Pixastic.log("Could not create real worker, running from file://")
|
Pixastic.log("Could not create real worker, running from file://")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue