aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/transform.js29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/transform.js b/src/transform.js
index 33f5019..37b5e3b 100644
--- a/src/transform.js
+++ b/src/transform.js
@@ -221,19 +221,17 @@ SVG.Transformation = SVG.invent({
create: function(source, inversed){
if(arguments.length > 1 && typeof inversed != 'boolean'){
- return this.create([].slice.call(arguments))
- }
-
- if(typeof source == 'object'){
- for(var i = 0, len = this.arguments.length; i < len; ++i){
- this[this.arguments[i]] = source[this.arguments[i]]
- }
+ return this.constructor.call(this, [].slice.call(arguments))
}
if(Array.isArray(source)){
for(var i = 0, len = this.arguments.length; i < len; ++i){
this[this.arguments[i]] = source[i]
}
+ } else if(typeof source == 'object'){
+ for(var i = 0, len = this.arguments.length; i < len; ++i){
+ this[this.arguments[i]] = source[this.arguments[i]]
+ }
}
this.inversed = false
@@ -246,7 +244,10 @@ SVG.Transformation = SVG.invent({
, extend: {
- at: function(pos){
+ arguments: []
+ , method: ''
+
+ , at: function(pos){
var params = []
@@ -288,8 +289,7 @@ SVG.Translate = SVG.invent({
, inherit: SVG.Transformation
, create: function(source, inversed){
- if(typeof source == 'object') this.constructor.call(this, source, inversed)
- else this.constructor.call(this, [].slice.call(arguments))
+ this.constructor.apply(this, [].slice.call(arguments))
}
, extend: {
@@ -305,8 +305,7 @@ SVG.Rotate = SVG.invent({
, inherit: SVG.Transformation
, create: function(source, inversed){
- if(typeof source == 'object') this.constructor.call(this, source, inversed)
- else this.constructor.call(this, [].slice.call(arguments))
+ this.constructor.apply(this, [].slice.call(arguments))
}
, extend: {
@@ -329,8 +328,7 @@ SVG.Scale = SVG.invent({
, inherit: SVG.Transformation
, create: function(source, inversed){
- if(typeof source == 'object') this.constructor.call(this, source, inversed)
- else this.constructor.call(this, [].slice.call(arguments))
+ this.constructor.apply(this, [].slice.call(arguments))
}
, extend: {
@@ -346,8 +344,7 @@ SVG.Skew = SVG.invent({
, inherit: SVG.Transformation
, create: function(source, inversed){
- if(typeof source == 'object') this.constructor.call(this, source, inversed)
- else this.constructor.call(this, [].slice.call(arguments))
+ this.constructor.apply(this, [].slice.call(arguments))
}
, extend: {