I\'m trying to use paper.js in a webapp, but I\'ve been unable to get it to work with multiple canvases. It\'s like the scopes are getting mixed up between the canvases, so when
@freejosh's answer works great for 10.2, but the fiddle still re-uses one canvas when upgrading to the latest version (12.2 as of now):
http://jsfiddle.net/ecneto/86qckn2h/1/
It's a simple fix, you can either downgrade, or make use of scope.activate(), which is feels a lot better than overriding paper:
http://jsfiddle.net/ecneto/n91rdp6z/2/
mypapers[0].activate();
var circle1 = new paper.Path.Circle(30, 30, 20);
circle1.style = {
fillColor: new paper.Color(1, .5, .5),
strokeColor: "black"
};
mypapers[1].activate();
var circle2 = new paper.Path.Circle(60, 60, 20);
circle2.style = {
fillColor: new paper.Color(.5, .5, 1),
strokeColor: "black"
};