mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Change scoped compilation of paper so that only a populated paper object is returned to the global scope, but nothing is installed yet.
This commit is contained in:
parent
a543801598
commit
5508e6eab6
2 changed files with 7 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
(function(scope) {
|
||||
var paper = new function() {
|
||||
|
||||
#include "paper.js"
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
|||
#include "util/CanvasProvider.js"
|
||||
#include "util/MathUtils.js"
|
||||
|
||||
paper.populate();
|
||||
paper.install(scope);
|
||||
return paper.populate();
|
||||
|
||||
})(this);
|
||||
};
|
||||
|
|
|
@ -4,15 +4,15 @@ var paper = {
|
|||
|
||||
populate: function() {
|
||||
// Inject all prototypes from the paper scope into the paper object.
|
||||
Base.each(['Point', 'Size', 'Rectangle', 'Matrix', 'DocumentView',
|
||||
// return this so build.js can use 'return paper.populate()'.
|
||||
return Base.each(['Point', 'Size', 'Rectangle', 'Matrix', 'DocumentView',
|
||||
'Doc', 'Symbol', 'Item', 'Group', 'Layer', 'Raster', 'PlacedSymbol',
|
||||
'PathStyle', 'Segment', 'Curve', 'PathItem', 'Path', 'CompoundPath',
|
||||
'Color', 'RGBColor', 'GrayColor', 'GradientColor', 'Gradient',
|
||||
'GradientStop', 'ToolEvent', 'ToolHandler', 'Tool'],
|
||||
function(name) {
|
||||
paper[name] = eval(name);
|
||||
}
|
||||
);
|
||||
this[name] = eval(name);
|
||||
}, this);
|
||||
},
|
||||
|
||||
install: function(scope) {
|
||||
|
|
Loading…
Reference in a new issue