mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-06 19:19:39 -04:00
Allow read() methods to receive an optional length parameter.
This commit is contained in:
parent
ecbd52cdf7
commit
3a46ac3b54
6 changed files with 12 additions and 12 deletions
src/basic
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue