mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Simplify injection of Path constructors.
This commit is contained in:
parent
2a1e00d127
commit
19121c33b2
1 changed files with 3 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
new function() {
|
||||
Path.inject({ statics: new function() {
|
||||
var kappa = 2 / 3 * (Math.sqrt(2) - 1);
|
||||
|
||||
var ovalSegments = [
|
||||
|
@ -8,7 +8,7 @@ new function() {
|
|||
new Segment([0.5, 1], [kappa, 0 ], [-kappa, 0])
|
||||
];
|
||||
|
||||
var constructors = {
|
||||
return {
|
||||
Line: function() {
|
||||
var path = new Path();
|
||||
if (arguments.length == 2) {
|
||||
|
@ -104,6 +104,4 @@ new function() {
|
|||
return path;
|
||||
}
|
||||
};
|
||||
|
||||
Path.inject({ statics: constructors });
|
||||
};
|
||||
}});
|
||||
|
|
Loading…
Reference in a new issue