Update docs and dist version to 0.2.

This commit is contained in:
Jürg Lehni 2011-08-01 12:05:06 +01:00
parent ea629fefda
commit 4fa6ffeb01
47 changed files with 4846 additions and 1903 deletions

File diff suppressed because one or more lines are too long

View file

@ -119,10 +119,15 @@ PaperScript = HtmlElement.extend({
var scope = paper.PaperScope.get(script.$);
if (scope) {
// Update script to edited version
script.setText(editor.getValue());
var code = editor.getValue();
script.setText(code);
// Keep a reference to the used canvas, since we're going to
// fully clear the scope and initialize again with this canvas.
var canvas = scope.view.canvas;
// Clear scope first, then evaluate a new script.
scope.clear();
scope.evaluate(script.$);
scope.initialize(canvas);
scope.evaluate(code);
}
}