mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -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 kappa = 2 / 3 * (Math.sqrt(2) - 1);
|
||||||
|
|
||||||
var ovalSegments = [
|
var ovalSegments = [
|
||||||
|
@ -8,7 +8,7 @@ new function() {
|
||||||
new Segment([0.5, 1], [kappa, 0 ], [-kappa, 0])
|
new Segment([0.5, 1], [kappa, 0 ], [-kappa, 0])
|
||||||
];
|
];
|
||||||
|
|
||||||
var constructors = {
|
return {
|
||||||
Line: function() {
|
Line: function() {
|
||||||
var path = new Path();
|
var path = new Path();
|
||||||
if (arguments.length == 2) {
|
if (arguments.length == 2) {
|
||||||
|
@ -104,6 +104,4 @@ new function() {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}});
|
||||||
Path.inject({ statics: constructors });
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in a new issue