mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 22:29:11 -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
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue