diff options
author | wout <wout@impinc.co.uk> | 2014-07-23 11:44:50 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-07-23 11:44:50 +0200 |
commit | 94077ff77815f622f6ad0daebf26160ec33e0271 (patch) | |
tree | 12e9ab6df8e3fe699f2489ea3d57fe2b8b15239b /src | |
parent | 6ac0193538a6358d017875c3a4b183f76894daeb (diff) | |
download | svg.js-94077ff77815f622f6ad0daebf26160ec33e0271.tar.gz svg.js-94077ff77815f622f6ad0daebf26160ec33e0271.zip |
Moved SVG.invent to main svg.js file
Diffstat (limited to 'src')
-rwxr-xr-x | src/default.js | 23 | ||||
-rwxr-xr-x | src/inventor.js | 23 | ||||
-rwxr-xr-x | src/svg.js | 24 |
3 files changed, 24 insertions, 46 deletions
diff --git a/src/default.js b/src/default.js index 0c9ba33..eb3d504 100755 --- a/src/default.js +++ b/src/default.js @@ -32,28 +32,5 @@ SVG.defaults = { , 'font-family': 'Helvetica, Arial, sans-serif' , 'text-anchor': 'start' } - - // Transforms -, trans: { - /* translate */ - x: 0 - , y: 0 - /* scale */ - , scaleX: 1 - , scaleY: 1 - /* rotate */ - , rotation: 0 - /* skew */ - , skewX: 0 - , skewY: 0 - /* matrix */ - , matrix: this.matrix - , a: 1 - , b: 0 - , c: 0 - , d: 1 - , e: 0 - , f: 0 - } }
\ No newline at end of file diff --git a/src/inventor.js b/src/inventor.js deleted file mode 100755 index f8244f5..0000000 --- a/src/inventor.js +++ /dev/null @@ -1,23 +0,0 @@ -// Invent new element -SVG.invent = function(config) { - /* create element initializer */ - var initializer = typeof config.create == 'function' ? - config.create : - function() { - this.constructor.call(this, SVG.create(config.create)) - } - - /* inherit prototype */ - if (config.inherit) - initializer.prototype = new config.inherit - - /* extend with methods */ - if (config.extend) - SVG.extend(initializer, config.extend) - - /* attach construct method to parent */ - if (config.construct) - SVG.extend(config.parent || SVG.Container, config.construct) - - return initializer -}
\ No newline at end of file @@ -55,6 +55,30 @@ SVG.extend = function() { SVG.Set.inherit() } +// Invent new element +SVG.invent = function(config) { + /* create element initializer */ + var initializer = typeof config.create == 'function' ? + config.create : + function() { + this.constructor.call(this, SVG.create(config.create)) + } + + /* inherit prototype */ + if (config.inherit) + initializer.prototype = new config.inherit + + /* extend with methods */ + if (config.extend) + SVG.extend(initializer, config.extend) + + /* attach construct method to parent */ + if (config.construct) + SVG.extend(config.parent || SVG.Container, config.construct) + + return initializer +} + // Initialize parsing element SVG.prepare = function(element) { /* select document body and create invisible svg element */ |