paper.js/examples/Worker/Worker.js
Jürg Lehni 8fb7c41537 Implement support for web-workers.
Relates to #634, closes #582
2016-02-02 17:30:38 +01:00

14 lines
388 B
JavaScript

importScripts('../../dist/paper-full.js');
paper.install(this);
paper.setup([640, 480]);
onmessage = function(event) {
var data = event.data;
if (data) {
var path1 = project.importJSON(data[0]);
var path2 = project.importJSON(data[1]);
console.log(path1, path2);
var result = path1.unite(path2);
postMessage(result.exportJSON());
}
};