From 178b09caa73df6df3b1c3d8c15dbc3f1a0b2c51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 30 May 2013 11:26:47 -0700 Subject: [PATCH] Fix issue with local paper variable shielding global one. We need a cleaner fix for this on the long run. --- src/core/PaperScopeItem.js | 2 +- src/export.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/PaperScopeItem.js b/src/core/PaperScopeItem.js index 4ded713c..63c54da8 100644 --- a/src/core/PaperScopeItem.js +++ b/src/core/PaperScopeItem.js @@ -27,7 +27,7 @@ var PaperScopeItem = Base.extend(Callback, /** @lends PaperScopeItem# */{ initialize: function(activate) { // Store reference to the currently active global paper scope: this._scope = paper; - // Push it onto this._scope.projects and set index: + // Push it onto this._scope[this._list] and set _index: this._index = this._scope[this._list].push(this) - 1; // If the project has no active reference, activate this one if (activate || !this._scope[this._reference]) diff --git a/src/export.js b/src/export.js index d18df8bc..d3f6d937 100644 --- a/src/export.js +++ b/src/export.js @@ -12,7 +12,7 @@ // Add PaperScript and Numerical to exports, inject all exports into PaperScope, // and create the initial paper object, all in one condensed statement: -var paper = new (PaperScope.inject(Base.exports.inject({ +paper = new (PaperScope.inject(Base.exports.inject({ PaperScript: PaperScript, Numerical: Numerical })))();