diff --git a/src/basic/Point.js b/src/basic/Point.js index 969eda4e..1aa72435 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -477,8 +477,8 @@ var Point = Base.extend({ return point; }, - read: function(args, index) { - var index = index || 0, length = args.length - index; + read: function(args, index, length) { + var index = index || 0, length = length || args.length - index; if (length == 1 && args[index] instanceof Point) { return args[index]; } else if (length != 0) { diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index 35444ed7..72206e65 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -285,8 +285,8 @@ Rectangle = Base.extend({ }, statics: { - read: function(args, index) { - var index = index || 0, length = args.length - index; + read: function(args, index, length) { + var index = index || 0, length = length || args.length - index; if (length == 1 && args[index] instanceof Rectangle) { return args[index]; } else if (length != 0) { diff --git a/src/basic/Size.js b/src/basic/Size.js index dae7c3fe..aa8d3f70 100644 --- a/src/basic/Size.js +++ b/src/basic/Size.js @@ -94,8 +94,8 @@ var Size = Base.extend({ }, statics: { - read: function(args, index) { - var index = index || 0, length = args.length - index; + read: function(args, index, length) { + var index = index || 0, length = length || args.length - index; if (length == 1 && args[index] instanceof Size) { return args[index]; } else if (length != 0) { diff --git a/src/color/Color.js b/src/color/Color.js index d233caeb..771cd0d9 100644 --- a/src/color/Color.js +++ b/src/color/Color.js @@ -31,8 +31,8 @@ Color = Base.extend({ }, statics: { - read: function(args, index) { - var index = index || 0, length = args.length - index; + read: function(args, index, length) { + var index = index || 0, length = length || args.length - index; if (length == 1 && args[index] instanceof Color) { return args[index]; } else if (length != 0 && args[0] !== null) { diff --git a/src/path/Curve.js b/src/path/Curve.js index d6ed51bc..435f810d 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -4,8 +4,8 @@ Curve = Base.extend({ statics: { - read: function(args, index) { - var index = index || 0, length = args.length - index; + read: function(args, index, length) { + var index = index || 0, length = length || args.length - index; if (length == 1 && args[index] instanceof Curve) { return args[index]; } else if (length != 0) { diff --git a/src/path/Segment.js b/src/path/Segment.js index 867f322e..e0ea1423 100644 --- a/src/path/Segment.js +++ b/src/path/Segment.js @@ -121,8 +121,8 @@ Segment = Base.extend({ }, statics: { - read: function(args, index) { - var index = index || 0, length = args.length - index; + read: function(args, index, length) { + var index = index || 0, length = length || args.length - index; if (length == 1 && args[index] instanceof Segment) { return args[index]; } else if (length != 0) {