From 19121c33b229683925246440d6b0a417fb33d9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 17 Feb 2011 20:04:02 +0000 Subject: [PATCH] Simplify injection of Path constructors. --- src/path/Path.Constructors.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index 1aaacb5e..30c44e7e 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -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 }); -}; \ No newline at end of file +}});