From 5485a7c700b370958c5f275cc1eb2694e4cf8cf8 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Mon, 6 May 2013 18:07:40 +0200 Subject: [PATCH] added worker control path option --- pixastic.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pixastic.js b/pixastic.js index 67eecaf..2c8dbcf 100644 --- a/pixastic.js +++ b/pixastic.js @@ -21,17 +21,18 @@ } } - function Pixastic(ctx) { + function Pixastic(ctx, workerControlPath) { var P = {}, width = ctx.canvas.width, height = ctx.canvas.height, - queue = []; - + queue = [], + workerControlPath = workerControlPath || ""; + if (!worker) { if (typeof window.Worker != "undefined") { try { - worker = new window.Worker("pixastic.worker.control.js"); + worker = new window.Worker(workerControlPath + "pixastic.worker.control.js"); } catch(e) { if (location.protocol == "file:") { Pixastic.log("Could not create real worker, running from file://")