mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-12 05:59:19 -04:00
Simplify the way the paper namespace is created and populated.
This commit is contained in:
parent
c6d79f964c
commit
92bf51a7cc
29 changed files with 38 additions and 50 deletions
src/util
|
@ -114,9 +114,7 @@ var PaperScript = new function() {
|
|||
}
|
||||
|
||||
function run(code) {
|
||||
// Use paper.extend() to create a paper scope within which the code is
|
||||
// evaluated.
|
||||
with (paper.extend()) {
|
||||
with (paper) {
|
||||
var tool = /onMouse(?:Up|Down|Move|Drag)/.test(code) && new Tool();
|
||||
var res = eval(compile(code));
|
||||
if (tool) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue