We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Pixastic instances share the worker, so if you have two instances that you operate simultaneously the result is not what you want.
The easiest fix is to move var worker; from the shared Pixastic variable space to the constructor so each instance has its own worker:
var worker;
diff --git a/pixastic.js b/pixastic.js index c9fb188..e0a7f3f 100644 --- a/pixastic.js +++ b/pixastic.js @@ -11,8 +11,6 @@ var Pixastic = (function() { - var worker; - function createImageData(ctx, width, height) { if (ctx.createImageData) { return ctx.createImageData(width, height); @@ -22,6 +20,8 @@ } function Pixastic(ctx, workerControlPath) { + var worker; + var P = {}, width = ctx.canvas.width,
There is probably a better way to do this, but I didn't spend time figuring it out.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The Pixastic instances share the worker, so if you have two instances that you operate simultaneously the result is not what you want.
The easiest fix is to move
var worker;
from the shared Pixastic variable space to the constructor so each instance has its own worker:There is probably a better way to do this, but I didn't spend time figuring it out.
The text was updated successfully, but these errors were encountered: