mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Prebuilt module for commit e539633852
This commit is contained in:
parent
1f7360d4df
commit
4eef765785
18 changed files with 423 additions and 318 deletions
185
dist/docs/assets/js/paper.js
vendored
185
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Jul 19 10:24:37 2016 +0200
|
* Date: Tue Jul 19 13:08:21 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -39,8 +39,13 @@ var window = self.window,
|
||||||
|
|
||||||
var Base = new function() {
|
var Base = new function() {
|
||||||
var hidden = /^(statics|enumerable|beans|preserve)$/,
|
var hidden = /^(statics|enumerable|beans|preserve)$/,
|
||||||
|
array = [],
|
||||||
|
slice = array.slice,
|
||||||
|
create = Object.create,
|
||||||
|
describe = Object.getOwnPropertyDescriptor,
|
||||||
|
define = Object.defineProperty,
|
||||||
|
|
||||||
forEach = [].forEach || function(iter, bind) {
|
forEach = array.forEach || function(iter, bind) {
|
||||||
for (var i = 0, l = this.length; i < l; i++) {
|
for (var i = 0, l = this.length; i < l; i++) {
|
||||||
iter.call(bind, this[i], i, this);
|
iter.call(bind, this[i], i, this);
|
||||||
}
|
}
|
||||||
|
@ -53,10 +58,6 @@ var Base = new function() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
create = Object.create,
|
|
||||||
describe = Object.getOwnPropertyDescriptor,
|
|
||||||
define = Object.defineProperty,
|
|
||||||
|
|
||||||
set = Object.assign || function(dst) {
|
set = Object.assign || function(dst) {
|
||||||
for (var i = 1, l = arguments.length; i < l; i++) {
|
for (var i = 1, l = arguments.length; i < l; i++) {
|
||||||
var src = arguments[i];
|
var src = arguments[i];
|
||||||
|
@ -76,6 +77,7 @@ var Base = new function() {
|
||||||
}
|
}
|
||||||
return bind;
|
return bind;
|
||||||
};
|
};
|
||||||
|
|
||||||
function inject(dest, src, enumerable, beans, preserve) {
|
function inject(dest, src, enumerable, beans, preserve) {
|
||||||
var beansNames = {};
|
var beansNames = {};
|
||||||
|
|
||||||
|
@ -216,6 +218,10 @@ var Base = new function() {
|
||||||
|
|
||||||
pick: function(a, b) {
|
pick: function(a, b) {
|
||||||
return a !== undefined ? a : b;
|
return a !== undefined ? a : b;
|
||||||
|
},
|
||||||
|
|
||||||
|
slice: function(list, begin, end) {
|
||||||
|
return slice.call(list, begin, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -309,7 +315,7 @@ Base.inject({
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
read: function(list, start, options, length) {
|
read: function(list, start, options, amount) {
|
||||||
if (this === Base) {
|
if (this === Base) {
|
||||||
var value = this.peek(list, start);
|
var value = this.peek(list, start);
|
||||||
list.__index++;
|
list.__index++;
|
||||||
|
@ -317,24 +323,24 @@ Base.inject({
|
||||||
}
|
}
|
||||||
var proto = this.prototype,
|
var proto = this.prototype,
|
||||||
readIndex = proto._readIndex,
|
readIndex = proto._readIndex,
|
||||||
index = start || readIndex && list.__index || 0;
|
begin = start || readIndex && list.__index || 0,
|
||||||
if (!length)
|
length = list.length,
|
||||||
length = list.length - index;
|
obj = list[begin];
|
||||||
var obj = list[index];
|
amount = amount || length - begin;
|
||||||
if (obj instanceof this
|
if (obj instanceof this
|
||||||
|| options && options.readNull && obj == null && length <= 1) {
|
|| options && options.readNull && obj == null && amount <= 1) {
|
||||||
if (readIndex)
|
if (readIndex)
|
||||||
list.__index = index + 1;
|
list.__index = begin + 1;
|
||||||
return obj && options && options.clone ? obj.clone() : obj;
|
return obj && options && options.clone ? obj.clone() : obj;
|
||||||
}
|
}
|
||||||
obj = Base.create(this.prototype);
|
obj = Base.create(this.prototype);
|
||||||
if (readIndex)
|
if (readIndex)
|
||||||
obj.__read = true;
|
obj.__read = true;
|
||||||
obj = obj.initialize.apply(obj, index > 0 || length < list.length
|
obj = obj.initialize.apply(obj, begin > 0 || begin + amount < length
|
||||||
? Array.prototype.slice.call(list, index, index + length)
|
? Base.slice(list, begin, begin + amount)
|
||||||
: list) || obj;
|
: list) || obj;
|
||||||
if (readIndex) {
|
if (readIndex) {
|
||||||
list.__index = index + obj.__read;
|
list.__index = begin + obj.__read;
|
||||||
obj.__read = undefined;
|
obj.__read = undefined;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -348,10 +354,12 @@ Base.inject({
|
||||||
return list.length - (list.__index || 0);
|
return list.length - (list.__index || 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
readAll: function(list, start, options) {
|
readList: function(list, start, options, amount) {
|
||||||
var res = [],
|
var res = [],
|
||||||
entry;
|
entry,
|
||||||
for (var i = start || 0, l = list.length; i < l; i++) {
|
begin = start || 0,
|
||||||
|
end = amount ? begin + amount : list.length;
|
||||||
|
for (var i = begin; i < end; i++) {
|
||||||
res.push(Array.isArray(entry = list[i])
|
res.push(Array.isArray(entry = list[i])
|
||||||
? this.read(entry, 0, options)
|
? this.read(entry, 0, options)
|
||||||
: this.read(list, i, options, 1));
|
: this.read(list, i, options, 1));
|
||||||
|
@ -359,7 +367,7 @@ Base.inject({
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
readNamed: function(list, name, start, options, length) {
|
readNamed: function(list, name, start, options, amount) {
|
||||||
var value = this.getNamed(list, name),
|
var value = this.getNamed(list, name),
|
||||||
hasObject = value !== undefined;
|
hasObject = value !== undefined;
|
||||||
if (hasObject) {
|
if (hasObject) {
|
||||||
|
@ -370,7 +378,7 @@ Base.inject({
|
||||||
}
|
}
|
||||||
filtered[name] = undefined;
|
filtered[name] = undefined;
|
||||||
}
|
}
|
||||||
return this.read(hasObject ? [value] : list, start, options, length);
|
return this.read(hasObject ? [value] : list, start, options, amount);
|
||||||
},
|
},
|
||||||
|
|
||||||
getNamed: function(list, name) {
|
getNamed: function(list, name) {
|
||||||
|
@ -622,7 +630,7 @@ var Emitter = {
|
||||||
var handlers = this._callbacks && this._callbacks[type];
|
var handlers = this._callbacks && this._callbacks[type];
|
||||||
if (!handlers)
|
if (!handlers)
|
||||||
return false;
|
return false;
|
||||||
var args = [].slice.call(arguments, 1),
|
var args = Base.slice(arguments, 1),
|
||||||
setTarget = event && event.target && !event.currentTarget;
|
setTarget = event && event.target && !event.currentTarget;
|
||||||
handlers = handlers.slice();
|
handlers = handlers.slice();
|
||||||
if (setTarget)
|
if (setTarget)
|
||||||
|
@ -3860,13 +3868,13 @@ new function() {
|
||||||
return this.insertChildren(this._children.length, items, _preserve);
|
return this.insertChildren(this._children.length, items, _preserve);
|
||||||
},
|
},
|
||||||
|
|
||||||
insertChildren: function(index, items, _preserve, _proto) {
|
insertChildren: function(index, items, _preserve) {
|
||||||
var children = this._children;
|
var children = this._children;
|
||||||
if (children && items && items.length > 0) {
|
if (children && items && items.length > 0) {
|
||||||
items = Array.prototype.slice.apply(items);
|
items = Base.slice(items);
|
||||||
for (var i = items.length - 1; i >= 0; i--) {
|
for (var i = items.length - 1; i >= 0; i--) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
if (!item || _proto && !(item instanceof _proto)) {
|
if (!item) {
|
||||||
items.splice(i, 1);
|
items.splice(i, 1);
|
||||||
} else {
|
} else {
|
||||||
item._remove(false, true);
|
item._remove(false, true);
|
||||||
|
@ -5432,27 +5440,25 @@ var Segment = Base.extend({
|
||||||
|
|
||||||
initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) {
|
initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) {
|
||||||
var count = arguments.length,
|
var count = arguments.length,
|
||||||
point, handleIn, handleOut,
|
point, handleIn, handleOut, selection;
|
||||||
selection;
|
if (count > 0) {
|
||||||
if (count === 0) {
|
if (arg0 == null || typeof arg0 === 'object') {
|
||||||
} else if (count === 1) {
|
if (count === 1 && arg0 && 'point' in arg0) {
|
||||||
if (arg0 && 'point' in arg0) {
|
point = arg0.point;
|
||||||
point = arg0.point;
|
handleIn = arg0.handleIn;
|
||||||
handleIn = arg0.handleIn;
|
handleOut = arg0.handleOut;
|
||||||
handleOut = arg0.handleOut;
|
selection = arg0.selection;
|
||||||
selection = arg0.selection;
|
} else {
|
||||||
|
point = arg0;
|
||||||
|
handleIn = arg1;
|
||||||
|
handleOut = arg2;
|
||||||
|
selection = arg3;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
point = arg0;
|
point = [ arg0, arg1 ];
|
||||||
|
handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null;
|
||||||
|
handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null;
|
||||||
}
|
}
|
||||||
} else if (arg0 == null || typeof arg0 === 'object') {
|
|
||||||
point = arg0;
|
|
||||||
handleIn = arg1;
|
|
||||||
handleOut = arg2;
|
|
||||||
selection = arg3;
|
|
||||||
} else {
|
|
||||||
point = arg0 !== undefined ? [ arg0, arg1 ] : null;
|
|
||||||
handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null;
|
|
||||||
handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null;
|
|
||||||
}
|
}
|
||||||
new SegmentPoint(point, this, '_point');
|
new SegmentPoint(point, this, '_point');
|
||||||
new SegmentPoint(handleIn, this, '_handleIn');
|
new SegmentPoint(handleIn, this, '_handleIn');
|
||||||
|
@ -7364,10 +7370,28 @@ var PathItem = Item.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
statics: {
|
statics: {
|
||||||
create: function(pathData) {
|
|
||||||
var ctor = (pathData && pathData.match(/m/gi) || []).length > 1
|
create: function(arg) {
|
||||||
|| /z\s*\S+/i.test(pathData) ? CompoundPath : Path;
|
var data,
|
||||||
return new ctor(pathData);
|
segments,
|
||||||
|
compound;
|
||||||
|
if (Base.isPlainObject(arg)) {
|
||||||
|
segments = arg.segments;
|
||||||
|
data = arg.pathData;
|
||||||
|
} else if (Array.isArray(arg)) {
|
||||||
|
segments = arg;
|
||||||
|
} else if (typeof arg === 'string') {
|
||||||
|
data = arg;
|
||||||
|
}
|
||||||
|
if (segments) {
|
||||||
|
var first = segments[0];
|
||||||
|
compound = first && Array.isArray(first[0]);
|
||||||
|
} else if (data) {
|
||||||
|
compound = (data.match(/m/gi) || []).length > 1
|
||||||
|
|| /z\s*\S+/i.test(data);
|
||||||
|
}
|
||||||
|
var ctor = compound ? CompoundPath : Path;
|
||||||
|
return new ctor(arg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7676,12 +7700,19 @@ var Path = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
setSegments: function(segments) {
|
setSegments: function(segments) {
|
||||||
var fullySelected = this.isFullySelected();
|
var fullySelected = this.isFullySelected(),
|
||||||
|
length = segments && segments.length;
|
||||||
this._segments.length = 0;
|
this._segments.length = 0;
|
||||||
this._segmentSelection = 0;
|
this._segmentSelection = 0;
|
||||||
this._curves = undefined;
|
this._curves = undefined;
|
||||||
if (segments && segments.length > 0)
|
if (length) {
|
||||||
this._add(Segment.readAll(segments));
|
var last = segments[length - 1];
|
||||||
|
if (typeof last === 'boolean') {
|
||||||
|
this.setClosed(last);
|
||||||
|
length--;
|
||||||
|
}
|
||||||
|
this._add(Segment.readList(segments, 0, {}, length));
|
||||||
|
}
|
||||||
if (fullySelected)
|
if (fullySelected)
|
||||||
this.setFullySelected(true);
|
this.setFullySelected(true);
|
||||||
},
|
},
|
||||||
|
@ -7764,13 +7795,13 @@ var Path = PathItem.extend({
|
||||||
dy = curY - prevY;
|
dy = curY - prevY;
|
||||||
parts.push(
|
parts.push(
|
||||||
dx === 0 ? 'v' + f.number(dy)
|
dx === 0 ? 'v' + f.number(dy)
|
||||||
: dy === 0 ? 'h' + f.number(dx)
|
: dy === 0 ? 'h' + f.number(dx)
|
||||||
: 'l' + f.pair(dx, dy));
|
: 'l' + f.pair(dx, dy));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parts.push('c' + f.pair(outX - prevX, outY - prevY)
|
parts.push('c' + f.pair(outX - prevX, outY - prevY)
|
||||||
+ ' ' + f.pair(inX - prevX, inY - prevY)
|
+ ' ' + f.pair( inX - prevX, inY - prevY)
|
||||||
+ ' ' + f.pair(curX - prevX, curY - prevY));
|
+ ' ' + f.pair(curX - prevX, curY - prevY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevX = curX;
|
prevX = curX;
|
||||||
|
@ -7872,13 +7903,13 @@ var Path = PathItem.extend({
|
||||||
|
|
||||||
add: function(segment1 ) {
|
add: function(segment1 ) {
|
||||||
return arguments.length > 1 && typeof segment1 !== 'number'
|
return arguments.length > 1 && typeof segment1 !== 'number'
|
||||||
? this._add(Segment.readAll(arguments))
|
? this._add(Segment.readList(arguments))
|
||||||
: this._add([ Segment.read(arguments) ])[0];
|
: this._add([ Segment.read(arguments) ])[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
insert: function(index, segment1 ) {
|
insert: function(index, segment1 ) {
|
||||||
return arguments.length > 2 && typeof segment1 !== 'number'
|
return arguments.length > 2 && typeof segment1 !== 'number'
|
||||||
? this._add(Segment.readAll(arguments, 1), index)
|
? this._add(Segment.readList(arguments, 1), index)
|
||||||
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7891,11 +7922,11 @@ var Path = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
addSegments: function(segments) {
|
addSegments: function(segments) {
|
||||||
return this._add(Segment.readAll(segments));
|
return this._add(Segment.readList(segments));
|
||||||
},
|
},
|
||||||
|
|
||||||
insertSegments: function(index, segments) {
|
insertSegments: function(index, segments) {
|
||||||
return this._add(Segment.readAll(segments), index);
|
return this._add(Segment.readList(segments), index);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeSegment: function(index) {
|
removeSegment: function(index) {
|
||||||
|
@ -9282,21 +9313,30 @@ var CompoundPath = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
insertChildren: function insertChildren(index, items, _preserve) {
|
insertChildren: function insertChildren(index, items, _preserve) {
|
||||||
|
var list = items,
|
||||||
|
first = list[0];
|
||||||
|
if (first && typeof first[0] === 'number')
|
||||||
|
list = [list];
|
||||||
for (var i = items.length - 1; i >= 0; i--) {
|
for (var i = items.length - 1; i >= 0; i--) {
|
||||||
var item = items[i];
|
var item = list[i];
|
||||||
if (item instanceof CompoundPath) {
|
if (list === items && !(item instanceof Path))
|
||||||
items = items.slice();
|
list = Base.slice(list);
|
||||||
items.splice.apply(items, [i, 1].concat(item.removeChildren()));
|
if (Array.isArray(item)) {
|
||||||
|
var path = new Path({ segments: item, insert: false });
|
||||||
|
path.setClockwise(path.isClockwise());
|
||||||
|
list[i] = path;
|
||||||
|
} else if (item instanceof CompoundPath) {
|
||||||
|
list.splice.apply(list, [i, 1].concat(item.removeChildren()));
|
||||||
item.remove();
|
item.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
items = insertChildren.base.call(this, index, items, _preserve, Path);
|
list = insertChildren.base.call(this, index, list, _preserve);
|
||||||
for (var i = 0, l = !_preserve && items && items.length; i < l; i++) {
|
for (var i = 0, l = !_preserve && list && list.length; i < l; i++) {
|
||||||
var item = items[i];
|
var item = list[i];
|
||||||
if (item._clockwise === undefined)
|
if (item._clockwise === undefined)
|
||||||
item.setClockwise(item._index === 0);
|
item.setClockwise(item._index === 0);
|
||||||
}
|
}
|
||||||
return items;
|
return list;
|
||||||
},
|
},
|
||||||
|
|
||||||
reduce: function reduce(options) {
|
reduce: function reduce(options) {
|
||||||
|
@ -10793,8 +10833,7 @@ var Color = Base.extend(new function() {
|
||||||
_readIndex: true,
|
_readIndex: true,
|
||||||
|
|
||||||
initialize: function Color(arg) {
|
initialize: function Color(arg) {
|
||||||
var slice = Array.prototype.slice,
|
var args = arguments,
|
||||||
args = arguments,
|
|
||||||
reading = this.__read,
|
reading = this.__read,
|
||||||
read = 0,
|
read = 0,
|
||||||
type,
|
type,
|
||||||
|
@ -10815,7 +10854,7 @@ var Color = Base.extend(new function() {
|
||||||
} else {
|
} else {
|
||||||
if (reading)
|
if (reading)
|
||||||
read = 1;
|
read = 1;
|
||||||
args = slice.call(args, 1);
|
args = Base.slice(args, 1);
|
||||||
argType = typeof arg;
|
argType = typeof arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10838,7 +10877,7 @@ var Color = Base.extend(new function() {
|
||||||
: 1;
|
: 1;
|
||||||
}
|
}
|
||||||
if (values.length > length)
|
if (values.length > length)
|
||||||
values = slice.call(values, 0, length);
|
values = Base.slice(values, 0, length);
|
||||||
} else if (argType === 'string') {
|
} else if (argType === 'string') {
|
||||||
type = 'rgb';
|
type = 'rgb';
|
||||||
components = fromCSS(arg);
|
components = fromCSS(arg);
|
||||||
|
@ -11180,7 +11219,7 @@ var Gradient = Base.extend({
|
||||||
for (var i = 0, l = _stops.length; i < l; i++)
|
for (var i = 0, l = _stops.length; i < l; i++)
|
||||||
_stops[i]._owner = undefined;
|
_stops[i]._owner = undefined;
|
||||||
}
|
}
|
||||||
_stops = this._stops = GradientStop.readAll(stops, 0, { clone: true });
|
_stops = this._stops = GradientStop.readList(stops, 0, { clone: true });
|
||||||
for (var i = 0, l = _stops.length; i < l; i++)
|
for (var i = 0, l = _stops.length; i < l; i++)
|
||||||
_stops[i]._owner = this;
|
_stops[i]._owner = this;
|
||||||
this._changed();
|
this._changed();
|
||||||
|
@ -12363,7 +12402,7 @@ var CanvasView = View.extend({
|
||||||
if (size.isZero())
|
if (size.isZero())
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Cannot create CanvasView with the provided argument: '
|
'Cannot create CanvasView with the provided argument: '
|
||||||
+ [].slice.call(arguments, 1));
|
+ Base.slice(arguments, 1));
|
||||||
canvas = CanvasProvider.getCanvas(size);
|
canvas = CanvasProvider.getCanvas(size);
|
||||||
}
|
}
|
||||||
var ctx = this._context = canvas.getContext('2d');
|
var ctx = this._context = canvas.getContext('2d');
|
||||||
|
|
6
dist/docs/classes/CompoundPath.html
vendored
6
dist/docs/classes/CompoundPath.html
vendored
|
@ -42,7 +42,7 @@
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties to be set on the path
|
— an object containing properties to be set on the path
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5850,7 +5850,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5997,7 +5997,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
6
dist/docs/classes/Group.html
vendored
6
dist/docs/classes/Group.html
vendored
|
@ -134,7 +134,7 @@ function onFrame(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing the properties to be set on the group
|
— an object containing the properties to be set on the group
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5720,7 +5720,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5867,7 +5867,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
4
dist/docs/classes/Item.html
vendored
4
dist/docs/classes/Item.html
vendored
|
@ -5343,7 +5343,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5490,7 +5490,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
6
dist/docs/classes/Layer.html
vendored
6
dist/docs/classes/Layer.html
vendored
|
@ -84,7 +84,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing the properties to be set on the layer
|
— an object containing the properties to be set on the layer
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5634,7 +5634,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5781,7 +5781,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
20
dist/docs/classes/Path.html
vendored
20
dist/docs/classes/Path.html
vendored
|
@ -93,7 +93,7 @@ path.strokeColor = 'black';</code></pre>
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties to be set on the path
|
— an object containing properties to be set on the path
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ path.strokeColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ path.strokeColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -668,7 +668,7 @@ path.strokeColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -838,7 +838,7 @@ path.fillColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -983,7 +983,7 @@ path.strokeColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -1110,7 +1110,7 @@ triangle.fillColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -1246,7 +1246,7 @@ path.fillColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -8601,7 +8601,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -8748,7 +8748,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
78
dist/docs/classes/PathItem.html
vendored
78
dist/docs/classes/PathItem.html
vendored
|
@ -59,6 +59,37 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="reference-members">
|
||||||
|
<h2>Static Properties</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="create-pathData" class="member">
|
||||||
|
<div class="member-link">
|
||||||
|
<a name="create-pathData" href="#create-pathData"><tt><b>PathItem.create</b></tt></a>
|
||||||
|
</div>
|
||||||
|
<div class="member-description hidden">
|
||||||
|
|
||||||
|
<div class="member-text">
|
||||||
|
<p>Creates a path item from the given SVG path-data, determining if the data describes a plain path or a compound-path with multiple sub-paths.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<ul class="member-list">
|
||||||
|
<h4>Type:</h4>
|
||||||
|
<li>
|
||||||
|
<a href="../classes/Path.html"><tt>Path</tt></a>⟋<a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ============================== methods ================================ -->
|
<!-- ============================== methods ================================ -->
|
||||||
|
@ -1630,49 +1661,6 @@ path.smooth();
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="reference-members">
|
|
||||||
<h2>Static Methods</h2>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="create-pathData" class="member">
|
|
||||||
<div class="member-link">
|
|
||||||
<a name="create-pathData" href="#create-pathData"><tt><b>PathItem.create</b>(pathData)</tt></a>
|
|
||||||
</div>
|
|
||||||
<div class="member-description hidden">
|
|
||||||
<div class="member-text">
|
|
||||||
<p>Creates a path item from the given SVG path-data, determining if the data describes a plain path or a compound-path with multiple sub-paths.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="member-list">
|
|
||||||
<h4>Parameters:</h4>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<tt>pathData:</tt>
|
|
||||||
<tt>String</tt>
|
|
||||||
— the SVG path-data to parse
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="member-list">
|
|
||||||
<h4>Returns:</h4>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<tt><a href="../classes/Path.html"><tt>Path</tt></a>⟋<a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a></tt> — the newly created path item
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- =========================== inherited properties ====================== -->
|
<!-- =========================== inherited properties ====================== -->
|
||||||
|
@ -7134,7 +7122,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -7281,7 +7269,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
6
dist/docs/classes/PointText.html
vendored
6
dist/docs/classes/PointText.html
vendored
|
@ -96,7 +96,7 @@ text.content = 'The contents of the point text';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the path’s attributes
|
— an object containing properties describing the path’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5643,7 +5643,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5790,7 +5790,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
4
dist/docs/classes/Raster.html
vendored
4
dist/docs/classes/Raster.html
vendored
|
@ -6456,7 +6456,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -6603,7 +6603,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
2
dist/docs/classes/Segment.html
vendored
2
dist/docs/classes/Segment.html
vendored
|
@ -116,7 +116,7 @@ path.strokeColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties to be set on the segment
|
— an object containing properties to be set on the segment
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
10
dist/docs/classes/Shape.html
vendored
10
dist/docs/classes/Shape.html
vendored
|
@ -101,7 +101,7 @@ shape.strokeColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the shape’s attributes
|
— an object containing properties describing the shape’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ shape.strokeColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the shape’s attributes
|
— an object containing properties describing the shape’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ shape.fillColor = 'black';
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing properties describing the shape’s attributes
|
— an object containing properties describing the shape’s attributes
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -6198,7 +6198,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -6345,7 +6345,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
4
dist/docs/classes/SymbolItem.html
vendored
4
dist/docs/classes/SymbolItem.html
vendored
|
@ -5614,7 +5614,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5761,7 +5761,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
4
dist/docs/classes/TextItem.html
vendored
4
dist/docs/classes/TextItem.html
vendored
|
@ -5731,7 +5731,7 @@ path.on('mouseleave', function() {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -5878,7 +5878,7 @@ function onMouseDown(event) {
|
||||||
<li>
|
<li>
|
||||||
<tt>object:</tt>
|
<tt>object:</tt>
|
||||||
<tt>Object</tt>
|
<tt>Object</tt>
|
||||||
— an object literal containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
185
dist/paper-core.js
vendored
185
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Jul 19 10:24:37 2016 +0200
|
* Date: Tue Jul 19 13:08:21 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -39,8 +39,13 @@ var window = self.window,
|
||||||
|
|
||||||
var Base = new function() {
|
var Base = new function() {
|
||||||
var hidden = /^(statics|enumerable|beans|preserve)$/,
|
var hidden = /^(statics|enumerable|beans|preserve)$/,
|
||||||
|
array = [],
|
||||||
|
slice = array.slice,
|
||||||
|
create = Object.create,
|
||||||
|
describe = Object.getOwnPropertyDescriptor,
|
||||||
|
define = Object.defineProperty,
|
||||||
|
|
||||||
forEach = [].forEach || function(iter, bind) {
|
forEach = array.forEach || function(iter, bind) {
|
||||||
for (var i = 0, l = this.length; i < l; i++) {
|
for (var i = 0, l = this.length; i < l; i++) {
|
||||||
iter.call(bind, this[i], i, this);
|
iter.call(bind, this[i], i, this);
|
||||||
}
|
}
|
||||||
|
@ -53,10 +58,6 @@ var Base = new function() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
create = Object.create,
|
|
||||||
describe = Object.getOwnPropertyDescriptor,
|
|
||||||
define = Object.defineProperty,
|
|
||||||
|
|
||||||
set = Object.assign || function(dst) {
|
set = Object.assign || function(dst) {
|
||||||
for (var i = 1, l = arguments.length; i < l; i++) {
|
for (var i = 1, l = arguments.length; i < l; i++) {
|
||||||
var src = arguments[i];
|
var src = arguments[i];
|
||||||
|
@ -76,6 +77,7 @@ var Base = new function() {
|
||||||
}
|
}
|
||||||
return bind;
|
return bind;
|
||||||
};
|
};
|
||||||
|
|
||||||
function inject(dest, src, enumerable, beans, preserve) {
|
function inject(dest, src, enumerable, beans, preserve) {
|
||||||
var beansNames = {};
|
var beansNames = {};
|
||||||
|
|
||||||
|
@ -216,6 +218,10 @@ var Base = new function() {
|
||||||
|
|
||||||
pick: function(a, b) {
|
pick: function(a, b) {
|
||||||
return a !== undefined ? a : b;
|
return a !== undefined ? a : b;
|
||||||
|
},
|
||||||
|
|
||||||
|
slice: function(list, begin, end) {
|
||||||
|
return slice.call(list, begin, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -309,7 +315,7 @@ Base.inject({
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
read: function(list, start, options, length) {
|
read: function(list, start, options, amount) {
|
||||||
if (this === Base) {
|
if (this === Base) {
|
||||||
var value = this.peek(list, start);
|
var value = this.peek(list, start);
|
||||||
list.__index++;
|
list.__index++;
|
||||||
|
@ -317,24 +323,24 @@ Base.inject({
|
||||||
}
|
}
|
||||||
var proto = this.prototype,
|
var proto = this.prototype,
|
||||||
readIndex = proto._readIndex,
|
readIndex = proto._readIndex,
|
||||||
index = start || readIndex && list.__index || 0;
|
begin = start || readIndex && list.__index || 0,
|
||||||
if (!length)
|
length = list.length,
|
||||||
length = list.length - index;
|
obj = list[begin];
|
||||||
var obj = list[index];
|
amount = amount || length - begin;
|
||||||
if (obj instanceof this
|
if (obj instanceof this
|
||||||
|| options && options.readNull && obj == null && length <= 1) {
|
|| options && options.readNull && obj == null && amount <= 1) {
|
||||||
if (readIndex)
|
if (readIndex)
|
||||||
list.__index = index + 1;
|
list.__index = begin + 1;
|
||||||
return obj && options && options.clone ? obj.clone() : obj;
|
return obj && options && options.clone ? obj.clone() : obj;
|
||||||
}
|
}
|
||||||
obj = Base.create(this.prototype);
|
obj = Base.create(this.prototype);
|
||||||
if (readIndex)
|
if (readIndex)
|
||||||
obj.__read = true;
|
obj.__read = true;
|
||||||
obj = obj.initialize.apply(obj, index > 0 || length < list.length
|
obj = obj.initialize.apply(obj, begin > 0 || begin + amount < length
|
||||||
? Array.prototype.slice.call(list, index, index + length)
|
? Base.slice(list, begin, begin + amount)
|
||||||
: list) || obj;
|
: list) || obj;
|
||||||
if (readIndex) {
|
if (readIndex) {
|
||||||
list.__index = index + obj.__read;
|
list.__index = begin + obj.__read;
|
||||||
obj.__read = undefined;
|
obj.__read = undefined;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -348,10 +354,12 @@ Base.inject({
|
||||||
return list.length - (list.__index || 0);
|
return list.length - (list.__index || 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
readAll: function(list, start, options) {
|
readList: function(list, start, options, amount) {
|
||||||
var res = [],
|
var res = [],
|
||||||
entry;
|
entry,
|
||||||
for (var i = start || 0, l = list.length; i < l; i++) {
|
begin = start || 0,
|
||||||
|
end = amount ? begin + amount : list.length;
|
||||||
|
for (var i = begin; i < end; i++) {
|
||||||
res.push(Array.isArray(entry = list[i])
|
res.push(Array.isArray(entry = list[i])
|
||||||
? this.read(entry, 0, options)
|
? this.read(entry, 0, options)
|
||||||
: this.read(list, i, options, 1));
|
: this.read(list, i, options, 1));
|
||||||
|
@ -359,7 +367,7 @@ Base.inject({
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
readNamed: function(list, name, start, options, length) {
|
readNamed: function(list, name, start, options, amount) {
|
||||||
var value = this.getNamed(list, name),
|
var value = this.getNamed(list, name),
|
||||||
hasObject = value !== undefined;
|
hasObject = value !== undefined;
|
||||||
if (hasObject) {
|
if (hasObject) {
|
||||||
|
@ -370,7 +378,7 @@ Base.inject({
|
||||||
}
|
}
|
||||||
filtered[name] = undefined;
|
filtered[name] = undefined;
|
||||||
}
|
}
|
||||||
return this.read(hasObject ? [value] : list, start, options, length);
|
return this.read(hasObject ? [value] : list, start, options, amount);
|
||||||
},
|
},
|
||||||
|
|
||||||
getNamed: function(list, name) {
|
getNamed: function(list, name) {
|
||||||
|
@ -622,7 +630,7 @@ var Emitter = {
|
||||||
var handlers = this._callbacks && this._callbacks[type];
|
var handlers = this._callbacks && this._callbacks[type];
|
||||||
if (!handlers)
|
if (!handlers)
|
||||||
return false;
|
return false;
|
||||||
var args = [].slice.call(arguments, 1),
|
var args = Base.slice(arguments, 1),
|
||||||
setTarget = event && event.target && !event.currentTarget;
|
setTarget = event && event.target && !event.currentTarget;
|
||||||
handlers = handlers.slice();
|
handlers = handlers.slice();
|
||||||
if (setTarget)
|
if (setTarget)
|
||||||
|
@ -3860,13 +3868,13 @@ new function() {
|
||||||
return this.insertChildren(this._children.length, items, _preserve);
|
return this.insertChildren(this._children.length, items, _preserve);
|
||||||
},
|
},
|
||||||
|
|
||||||
insertChildren: function(index, items, _preserve, _proto) {
|
insertChildren: function(index, items, _preserve) {
|
||||||
var children = this._children;
|
var children = this._children;
|
||||||
if (children && items && items.length > 0) {
|
if (children && items && items.length > 0) {
|
||||||
items = Array.prototype.slice.apply(items);
|
items = Base.slice(items);
|
||||||
for (var i = items.length - 1; i >= 0; i--) {
|
for (var i = items.length - 1; i >= 0; i--) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
if (!item || _proto && !(item instanceof _proto)) {
|
if (!item) {
|
||||||
items.splice(i, 1);
|
items.splice(i, 1);
|
||||||
} else {
|
} else {
|
||||||
item._remove(false, true);
|
item._remove(false, true);
|
||||||
|
@ -5432,27 +5440,25 @@ var Segment = Base.extend({
|
||||||
|
|
||||||
initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) {
|
initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) {
|
||||||
var count = arguments.length,
|
var count = arguments.length,
|
||||||
point, handleIn, handleOut,
|
point, handleIn, handleOut, selection;
|
||||||
selection;
|
if (count > 0) {
|
||||||
if (count === 0) {
|
if (arg0 == null || typeof arg0 === 'object') {
|
||||||
} else if (count === 1) {
|
if (count === 1 && arg0 && 'point' in arg0) {
|
||||||
if (arg0 && 'point' in arg0) {
|
point = arg0.point;
|
||||||
point = arg0.point;
|
handleIn = arg0.handleIn;
|
||||||
handleIn = arg0.handleIn;
|
handleOut = arg0.handleOut;
|
||||||
handleOut = arg0.handleOut;
|
selection = arg0.selection;
|
||||||
selection = arg0.selection;
|
} else {
|
||||||
|
point = arg0;
|
||||||
|
handleIn = arg1;
|
||||||
|
handleOut = arg2;
|
||||||
|
selection = arg3;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
point = arg0;
|
point = [ arg0, arg1 ];
|
||||||
|
handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null;
|
||||||
|
handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null;
|
||||||
}
|
}
|
||||||
} else if (arg0 == null || typeof arg0 === 'object') {
|
|
||||||
point = arg0;
|
|
||||||
handleIn = arg1;
|
|
||||||
handleOut = arg2;
|
|
||||||
selection = arg3;
|
|
||||||
} else {
|
|
||||||
point = arg0 !== undefined ? [ arg0, arg1 ] : null;
|
|
||||||
handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null;
|
|
||||||
handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null;
|
|
||||||
}
|
}
|
||||||
new SegmentPoint(point, this, '_point');
|
new SegmentPoint(point, this, '_point');
|
||||||
new SegmentPoint(handleIn, this, '_handleIn');
|
new SegmentPoint(handleIn, this, '_handleIn');
|
||||||
|
@ -7364,10 +7370,28 @@ var PathItem = Item.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
statics: {
|
statics: {
|
||||||
create: function(pathData) {
|
|
||||||
var ctor = (pathData && pathData.match(/m/gi) || []).length > 1
|
create: function(arg) {
|
||||||
|| /z\s*\S+/i.test(pathData) ? CompoundPath : Path;
|
var data,
|
||||||
return new ctor(pathData);
|
segments,
|
||||||
|
compound;
|
||||||
|
if (Base.isPlainObject(arg)) {
|
||||||
|
segments = arg.segments;
|
||||||
|
data = arg.pathData;
|
||||||
|
} else if (Array.isArray(arg)) {
|
||||||
|
segments = arg;
|
||||||
|
} else if (typeof arg === 'string') {
|
||||||
|
data = arg;
|
||||||
|
}
|
||||||
|
if (segments) {
|
||||||
|
var first = segments[0];
|
||||||
|
compound = first && Array.isArray(first[0]);
|
||||||
|
} else if (data) {
|
||||||
|
compound = (data.match(/m/gi) || []).length > 1
|
||||||
|
|| /z\s*\S+/i.test(data);
|
||||||
|
}
|
||||||
|
var ctor = compound ? CompoundPath : Path;
|
||||||
|
return new ctor(arg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7676,12 +7700,19 @@ var Path = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
setSegments: function(segments) {
|
setSegments: function(segments) {
|
||||||
var fullySelected = this.isFullySelected();
|
var fullySelected = this.isFullySelected(),
|
||||||
|
length = segments && segments.length;
|
||||||
this._segments.length = 0;
|
this._segments.length = 0;
|
||||||
this._segmentSelection = 0;
|
this._segmentSelection = 0;
|
||||||
this._curves = undefined;
|
this._curves = undefined;
|
||||||
if (segments && segments.length > 0)
|
if (length) {
|
||||||
this._add(Segment.readAll(segments));
|
var last = segments[length - 1];
|
||||||
|
if (typeof last === 'boolean') {
|
||||||
|
this.setClosed(last);
|
||||||
|
length--;
|
||||||
|
}
|
||||||
|
this._add(Segment.readList(segments, 0, {}, length));
|
||||||
|
}
|
||||||
if (fullySelected)
|
if (fullySelected)
|
||||||
this.setFullySelected(true);
|
this.setFullySelected(true);
|
||||||
},
|
},
|
||||||
|
@ -7764,13 +7795,13 @@ var Path = PathItem.extend({
|
||||||
dy = curY - prevY;
|
dy = curY - prevY;
|
||||||
parts.push(
|
parts.push(
|
||||||
dx === 0 ? 'v' + f.number(dy)
|
dx === 0 ? 'v' + f.number(dy)
|
||||||
: dy === 0 ? 'h' + f.number(dx)
|
: dy === 0 ? 'h' + f.number(dx)
|
||||||
: 'l' + f.pair(dx, dy));
|
: 'l' + f.pair(dx, dy));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parts.push('c' + f.pair(outX - prevX, outY - prevY)
|
parts.push('c' + f.pair(outX - prevX, outY - prevY)
|
||||||
+ ' ' + f.pair(inX - prevX, inY - prevY)
|
+ ' ' + f.pair( inX - prevX, inY - prevY)
|
||||||
+ ' ' + f.pair(curX - prevX, curY - prevY));
|
+ ' ' + f.pair(curX - prevX, curY - prevY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevX = curX;
|
prevX = curX;
|
||||||
|
@ -7872,13 +7903,13 @@ var Path = PathItem.extend({
|
||||||
|
|
||||||
add: function(segment1 ) {
|
add: function(segment1 ) {
|
||||||
return arguments.length > 1 && typeof segment1 !== 'number'
|
return arguments.length > 1 && typeof segment1 !== 'number'
|
||||||
? this._add(Segment.readAll(arguments))
|
? this._add(Segment.readList(arguments))
|
||||||
: this._add([ Segment.read(arguments) ])[0];
|
: this._add([ Segment.read(arguments) ])[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
insert: function(index, segment1 ) {
|
insert: function(index, segment1 ) {
|
||||||
return arguments.length > 2 && typeof segment1 !== 'number'
|
return arguments.length > 2 && typeof segment1 !== 'number'
|
||||||
? this._add(Segment.readAll(arguments, 1), index)
|
? this._add(Segment.readList(arguments, 1), index)
|
||||||
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7891,11 +7922,11 @@ var Path = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
addSegments: function(segments) {
|
addSegments: function(segments) {
|
||||||
return this._add(Segment.readAll(segments));
|
return this._add(Segment.readList(segments));
|
||||||
},
|
},
|
||||||
|
|
||||||
insertSegments: function(index, segments) {
|
insertSegments: function(index, segments) {
|
||||||
return this._add(Segment.readAll(segments), index);
|
return this._add(Segment.readList(segments), index);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeSegment: function(index) {
|
removeSegment: function(index) {
|
||||||
|
@ -9282,21 +9313,30 @@ var CompoundPath = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
insertChildren: function insertChildren(index, items, _preserve) {
|
insertChildren: function insertChildren(index, items, _preserve) {
|
||||||
|
var list = items,
|
||||||
|
first = list[0];
|
||||||
|
if (first && typeof first[0] === 'number')
|
||||||
|
list = [list];
|
||||||
for (var i = items.length - 1; i >= 0; i--) {
|
for (var i = items.length - 1; i >= 0; i--) {
|
||||||
var item = items[i];
|
var item = list[i];
|
||||||
if (item instanceof CompoundPath) {
|
if (list === items && !(item instanceof Path))
|
||||||
items = items.slice();
|
list = Base.slice(list);
|
||||||
items.splice.apply(items, [i, 1].concat(item.removeChildren()));
|
if (Array.isArray(item)) {
|
||||||
|
var path = new Path({ segments: item, insert: false });
|
||||||
|
path.setClockwise(path.isClockwise());
|
||||||
|
list[i] = path;
|
||||||
|
} else if (item instanceof CompoundPath) {
|
||||||
|
list.splice.apply(list, [i, 1].concat(item.removeChildren()));
|
||||||
item.remove();
|
item.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
items = insertChildren.base.call(this, index, items, _preserve, Path);
|
list = insertChildren.base.call(this, index, list, _preserve);
|
||||||
for (var i = 0, l = !_preserve && items && items.length; i < l; i++) {
|
for (var i = 0, l = !_preserve && list && list.length; i < l; i++) {
|
||||||
var item = items[i];
|
var item = list[i];
|
||||||
if (item._clockwise === undefined)
|
if (item._clockwise === undefined)
|
||||||
item.setClockwise(item._index === 0);
|
item.setClockwise(item._index === 0);
|
||||||
}
|
}
|
||||||
return items;
|
return list;
|
||||||
},
|
},
|
||||||
|
|
||||||
reduce: function reduce(options) {
|
reduce: function reduce(options) {
|
||||||
|
@ -10793,8 +10833,7 @@ var Color = Base.extend(new function() {
|
||||||
_readIndex: true,
|
_readIndex: true,
|
||||||
|
|
||||||
initialize: function Color(arg) {
|
initialize: function Color(arg) {
|
||||||
var slice = Array.prototype.slice,
|
var args = arguments,
|
||||||
args = arguments,
|
|
||||||
reading = this.__read,
|
reading = this.__read,
|
||||||
read = 0,
|
read = 0,
|
||||||
type,
|
type,
|
||||||
|
@ -10815,7 +10854,7 @@ var Color = Base.extend(new function() {
|
||||||
} else {
|
} else {
|
||||||
if (reading)
|
if (reading)
|
||||||
read = 1;
|
read = 1;
|
||||||
args = slice.call(args, 1);
|
args = Base.slice(args, 1);
|
||||||
argType = typeof arg;
|
argType = typeof arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10838,7 +10877,7 @@ var Color = Base.extend(new function() {
|
||||||
: 1;
|
: 1;
|
||||||
}
|
}
|
||||||
if (values.length > length)
|
if (values.length > length)
|
||||||
values = slice.call(values, 0, length);
|
values = Base.slice(values, 0, length);
|
||||||
} else if (argType === 'string') {
|
} else if (argType === 'string') {
|
||||||
type = 'rgb';
|
type = 'rgb';
|
||||||
components = fromCSS(arg);
|
components = fromCSS(arg);
|
||||||
|
@ -11180,7 +11219,7 @@ var Gradient = Base.extend({
|
||||||
for (var i = 0, l = _stops.length; i < l; i++)
|
for (var i = 0, l = _stops.length; i < l; i++)
|
||||||
_stops[i]._owner = undefined;
|
_stops[i]._owner = undefined;
|
||||||
}
|
}
|
||||||
_stops = this._stops = GradientStop.readAll(stops, 0, { clone: true });
|
_stops = this._stops = GradientStop.readList(stops, 0, { clone: true });
|
||||||
for (var i = 0, l = _stops.length; i < l; i++)
|
for (var i = 0, l = _stops.length; i < l; i++)
|
||||||
_stops[i]._owner = this;
|
_stops[i]._owner = this;
|
||||||
this._changed();
|
this._changed();
|
||||||
|
@ -12363,7 +12402,7 @@ var CanvasView = View.extend({
|
||||||
if (size.isZero())
|
if (size.isZero())
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Cannot create CanvasView with the provided argument: '
|
'Cannot create CanvasView with the provided argument: '
|
||||||
+ [].slice.call(arguments, 1));
|
+ Base.slice(arguments, 1));
|
||||||
canvas = CanvasProvider.getCanvas(size);
|
canvas = CanvasProvider.getCanvas(size);
|
||||||
}
|
}
|
||||||
var ctx = this._context = canvas.getContext('2d');
|
var ctx = this._context = canvas.getContext('2d');
|
||||||
|
|
16
dist/paper-core.min.js
vendored
16
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
185
dist/paper-full.js
vendored
185
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Jul 19 10:24:37 2016 +0200
|
* Date: Tue Jul 19 13:08:21 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -39,8 +39,13 @@ var window = self.window,
|
||||||
|
|
||||||
var Base = new function() {
|
var Base = new function() {
|
||||||
var hidden = /^(statics|enumerable|beans|preserve)$/,
|
var hidden = /^(statics|enumerable|beans|preserve)$/,
|
||||||
|
array = [],
|
||||||
|
slice = array.slice,
|
||||||
|
create = Object.create,
|
||||||
|
describe = Object.getOwnPropertyDescriptor,
|
||||||
|
define = Object.defineProperty,
|
||||||
|
|
||||||
forEach = [].forEach || function(iter, bind) {
|
forEach = array.forEach || function(iter, bind) {
|
||||||
for (var i = 0, l = this.length; i < l; i++) {
|
for (var i = 0, l = this.length; i < l; i++) {
|
||||||
iter.call(bind, this[i], i, this);
|
iter.call(bind, this[i], i, this);
|
||||||
}
|
}
|
||||||
|
@ -53,10 +58,6 @@ var Base = new function() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
create = Object.create,
|
|
||||||
describe = Object.getOwnPropertyDescriptor,
|
|
||||||
define = Object.defineProperty,
|
|
||||||
|
|
||||||
set = Object.assign || function(dst) {
|
set = Object.assign || function(dst) {
|
||||||
for (var i = 1, l = arguments.length; i < l; i++) {
|
for (var i = 1, l = arguments.length; i < l; i++) {
|
||||||
var src = arguments[i];
|
var src = arguments[i];
|
||||||
|
@ -76,6 +77,7 @@ var Base = new function() {
|
||||||
}
|
}
|
||||||
return bind;
|
return bind;
|
||||||
};
|
};
|
||||||
|
|
||||||
function inject(dest, src, enumerable, beans, preserve) {
|
function inject(dest, src, enumerable, beans, preserve) {
|
||||||
var beansNames = {};
|
var beansNames = {};
|
||||||
|
|
||||||
|
@ -216,6 +218,10 @@ var Base = new function() {
|
||||||
|
|
||||||
pick: function(a, b) {
|
pick: function(a, b) {
|
||||||
return a !== undefined ? a : b;
|
return a !== undefined ? a : b;
|
||||||
|
},
|
||||||
|
|
||||||
|
slice: function(list, begin, end) {
|
||||||
|
return slice.call(list, begin, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -309,7 +315,7 @@ Base.inject({
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
read: function(list, start, options, length) {
|
read: function(list, start, options, amount) {
|
||||||
if (this === Base) {
|
if (this === Base) {
|
||||||
var value = this.peek(list, start);
|
var value = this.peek(list, start);
|
||||||
list.__index++;
|
list.__index++;
|
||||||
|
@ -317,24 +323,24 @@ Base.inject({
|
||||||
}
|
}
|
||||||
var proto = this.prototype,
|
var proto = this.prototype,
|
||||||
readIndex = proto._readIndex,
|
readIndex = proto._readIndex,
|
||||||
index = start || readIndex && list.__index || 0;
|
begin = start || readIndex && list.__index || 0,
|
||||||
if (!length)
|
length = list.length,
|
||||||
length = list.length - index;
|
obj = list[begin];
|
||||||
var obj = list[index];
|
amount = amount || length - begin;
|
||||||
if (obj instanceof this
|
if (obj instanceof this
|
||||||
|| options && options.readNull && obj == null && length <= 1) {
|
|| options && options.readNull && obj == null && amount <= 1) {
|
||||||
if (readIndex)
|
if (readIndex)
|
||||||
list.__index = index + 1;
|
list.__index = begin + 1;
|
||||||
return obj && options && options.clone ? obj.clone() : obj;
|
return obj && options && options.clone ? obj.clone() : obj;
|
||||||
}
|
}
|
||||||
obj = Base.create(this.prototype);
|
obj = Base.create(this.prototype);
|
||||||
if (readIndex)
|
if (readIndex)
|
||||||
obj.__read = true;
|
obj.__read = true;
|
||||||
obj = obj.initialize.apply(obj, index > 0 || length < list.length
|
obj = obj.initialize.apply(obj, begin > 0 || begin + amount < length
|
||||||
? Array.prototype.slice.call(list, index, index + length)
|
? Base.slice(list, begin, begin + amount)
|
||||||
: list) || obj;
|
: list) || obj;
|
||||||
if (readIndex) {
|
if (readIndex) {
|
||||||
list.__index = index + obj.__read;
|
list.__index = begin + obj.__read;
|
||||||
obj.__read = undefined;
|
obj.__read = undefined;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -348,10 +354,12 @@ Base.inject({
|
||||||
return list.length - (list.__index || 0);
|
return list.length - (list.__index || 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
readAll: function(list, start, options) {
|
readList: function(list, start, options, amount) {
|
||||||
var res = [],
|
var res = [],
|
||||||
entry;
|
entry,
|
||||||
for (var i = start || 0, l = list.length; i < l; i++) {
|
begin = start || 0,
|
||||||
|
end = amount ? begin + amount : list.length;
|
||||||
|
for (var i = begin; i < end; i++) {
|
||||||
res.push(Array.isArray(entry = list[i])
|
res.push(Array.isArray(entry = list[i])
|
||||||
? this.read(entry, 0, options)
|
? this.read(entry, 0, options)
|
||||||
: this.read(list, i, options, 1));
|
: this.read(list, i, options, 1));
|
||||||
|
@ -359,7 +367,7 @@ Base.inject({
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
readNamed: function(list, name, start, options, length) {
|
readNamed: function(list, name, start, options, amount) {
|
||||||
var value = this.getNamed(list, name),
|
var value = this.getNamed(list, name),
|
||||||
hasObject = value !== undefined;
|
hasObject = value !== undefined;
|
||||||
if (hasObject) {
|
if (hasObject) {
|
||||||
|
@ -370,7 +378,7 @@ Base.inject({
|
||||||
}
|
}
|
||||||
filtered[name] = undefined;
|
filtered[name] = undefined;
|
||||||
}
|
}
|
||||||
return this.read(hasObject ? [value] : list, start, options, length);
|
return this.read(hasObject ? [value] : list, start, options, amount);
|
||||||
},
|
},
|
||||||
|
|
||||||
getNamed: function(list, name) {
|
getNamed: function(list, name) {
|
||||||
|
@ -622,7 +630,7 @@ var Emitter = {
|
||||||
var handlers = this._callbacks && this._callbacks[type];
|
var handlers = this._callbacks && this._callbacks[type];
|
||||||
if (!handlers)
|
if (!handlers)
|
||||||
return false;
|
return false;
|
||||||
var args = [].slice.call(arguments, 1),
|
var args = Base.slice(arguments, 1),
|
||||||
setTarget = event && event.target && !event.currentTarget;
|
setTarget = event && event.target && !event.currentTarget;
|
||||||
handlers = handlers.slice();
|
handlers = handlers.slice();
|
||||||
if (setTarget)
|
if (setTarget)
|
||||||
|
@ -3860,13 +3868,13 @@ new function() {
|
||||||
return this.insertChildren(this._children.length, items, _preserve);
|
return this.insertChildren(this._children.length, items, _preserve);
|
||||||
},
|
},
|
||||||
|
|
||||||
insertChildren: function(index, items, _preserve, _proto) {
|
insertChildren: function(index, items, _preserve) {
|
||||||
var children = this._children;
|
var children = this._children;
|
||||||
if (children && items && items.length > 0) {
|
if (children && items && items.length > 0) {
|
||||||
items = Array.prototype.slice.apply(items);
|
items = Base.slice(items);
|
||||||
for (var i = items.length - 1; i >= 0; i--) {
|
for (var i = items.length - 1; i >= 0; i--) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
if (!item || _proto && !(item instanceof _proto)) {
|
if (!item) {
|
||||||
items.splice(i, 1);
|
items.splice(i, 1);
|
||||||
} else {
|
} else {
|
||||||
item._remove(false, true);
|
item._remove(false, true);
|
||||||
|
@ -5432,27 +5440,25 @@ var Segment = Base.extend({
|
||||||
|
|
||||||
initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) {
|
initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) {
|
||||||
var count = arguments.length,
|
var count = arguments.length,
|
||||||
point, handleIn, handleOut,
|
point, handleIn, handleOut, selection;
|
||||||
selection;
|
if (count > 0) {
|
||||||
if (count === 0) {
|
if (arg0 == null || typeof arg0 === 'object') {
|
||||||
} else if (count === 1) {
|
if (count === 1 && arg0 && 'point' in arg0) {
|
||||||
if (arg0 && 'point' in arg0) {
|
point = arg0.point;
|
||||||
point = arg0.point;
|
handleIn = arg0.handleIn;
|
||||||
handleIn = arg0.handleIn;
|
handleOut = arg0.handleOut;
|
||||||
handleOut = arg0.handleOut;
|
selection = arg0.selection;
|
||||||
selection = arg0.selection;
|
} else {
|
||||||
|
point = arg0;
|
||||||
|
handleIn = arg1;
|
||||||
|
handleOut = arg2;
|
||||||
|
selection = arg3;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
point = arg0;
|
point = [ arg0, arg1 ];
|
||||||
|
handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null;
|
||||||
|
handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null;
|
||||||
}
|
}
|
||||||
} else if (arg0 == null || typeof arg0 === 'object') {
|
|
||||||
point = arg0;
|
|
||||||
handleIn = arg1;
|
|
||||||
handleOut = arg2;
|
|
||||||
selection = arg3;
|
|
||||||
} else {
|
|
||||||
point = arg0 !== undefined ? [ arg0, arg1 ] : null;
|
|
||||||
handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null;
|
|
||||||
handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null;
|
|
||||||
}
|
}
|
||||||
new SegmentPoint(point, this, '_point');
|
new SegmentPoint(point, this, '_point');
|
||||||
new SegmentPoint(handleIn, this, '_handleIn');
|
new SegmentPoint(handleIn, this, '_handleIn');
|
||||||
|
@ -7364,10 +7370,28 @@ var PathItem = Item.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
statics: {
|
statics: {
|
||||||
create: function(pathData) {
|
|
||||||
var ctor = (pathData && pathData.match(/m/gi) || []).length > 1
|
create: function(arg) {
|
||||||
|| /z\s*\S+/i.test(pathData) ? CompoundPath : Path;
|
var data,
|
||||||
return new ctor(pathData);
|
segments,
|
||||||
|
compound;
|
||||||
|
if (Base.isPlainObject(arg)) {
|
||||||
|
segments = arg.segments;
|
||||||
|
data = arg.pathData;
|
||||||
|
} else if (Array.isArray(arg)) {
|
||||||
|
segments = arg;
|
||||||
|
} else if (typeof arg === 'string') {
|
||||||
|
data = arg;
|
||||||
|
}
|
||||||
|
if (segments) {
|
||||||
|
var first = segments[0];
|
||||||
|
compound = first && Array.isArray(first[0]);
|
||||||
|
} else if (data) {
|
||||||
|
compound = (data.match(/m/gi) || []).length > 1
|
||||||
|
|| /z\s*\S+/i.test(data);
|
||||||
|
}
|
||||||
|
var ctor = compound ? CompoundPath : Path;
|
||||||
|
return new ctor(arg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7676,12 +7700,19 @@ var Path = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
setSegments: function(segments) {
|
setSegments: function(segments) {
|
||||||
var fullySelected = this.isFullySelected();
|
var fullySelected = this.isFullySelected(),
|
||||||
|
length = segments && segments.length;
|
||||||
this._segments.length = 0;
|
this._segments.length = 0;
|
||||||
this._segmentSelection = 0;
|
this._segmentSelection = 0;
|
||||||
this._curves = undefined;
|
this._curves = undefined;
|
||||||
if (segments && segments.length > 0)
|
if (length) {
|
||||||
this._add(Segment.readAll(segments));
|
var last = segments[length - 1];
|
||||||
|
if (typeof last === 'boolean') {
|
||||||
|
this.setClosed(last);
|
||||||
|
length--;
|
||||||
|
}
|
||||||
|
this._add(Segment.readList(segments, 0, {}, length));
|
||||||
|
}
|
||||||
if (fullySelected)
|
if (fullySelected)
|
||||||
this.setFullySelected(true);
|
this.setFullySelected(true);
|
||||||
},
|
},
|
||||||
|
@ -7764,13 +7795,13 @@ var Path = PathItem.extend({
|
||||||
dy = curY - prevY;
|
dy = curY - prevY;
|
||||||
parts.push(
|
parts.push(
|
||||||
dx === 0 ? 'v' + f.number(dy)
|
dx === 0 ? 'v' + f.number(dy)
|
||||||
: dy === 0 ? 'h' + f.number(dx)
|
: dy === 0 ? 'h' + f.number(dx)
|
||||||
: 'l' + f.pair(dx, dy));
|
: 'l' + f.pair(dx, dy));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parts.push('c' + f.pair(outX - prevX, outY - prevY)
|
parts.push('c' + f.pair(outX - prevX, outY - prevY)
|
||||||
+ ' ' + f.pair(inX - prevX, inY - prevY)
|
+ ' ' + f.pair( inX - prevX, inY - prevY)
|
||||||
+ ' ' + f.pair(curX - prevX, curY - prevY));
|
+ ' ' + f.pair(curX - prevX, curY - prevY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevX = curX;
|
prevX = curX;
|
||||||
|
@ -7872,13 +7903,13 @@ var Path = PathItem.extend({
|
||||||
|
|
||||||
add: function(segment1 ) {
|
add: function(segment1 ) {
|
||||||
return arguments.length > 1 && typeof segment1 !== 'number'
|
return arguments.length > 1 && typeof segment1 !== 'number'
|
||||||
? this._add(Segment.readAll(arguments))
|
? this._add(Segment.readList(arguments))
|
||||||
: this._add([ Segment.read(arguments) ])[0];
|
: this._add([ Segment.read(arguments) ])[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
insert: function(index, segment1 ) {
|
insert: function(index, segment1 ) {
|
||||||
return arguments.length > 2 && typeof segment1 !== 'number'
|
return arguments.length > 2 && typeof segment1 !== 'number'
|
||||||
? this._add(Segment.readAll(arguments, 1), index)
|
? this._add(Segment.readList(arguments, 1), index)
|
||||||
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7891,11 +7922,11 @@ var Path = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
addSegments: function(segments) {
|
addSegments: function(segments) {
|
||||||
return this._add(Segment.readAll(segments));
|
return this._add(Segment.readList(segments));
|
||||||
},
|
},
|
||||||
|
|
||||||
insertSegments: function(index, segments) {
|
insertSegments: function(index, segments) {
|
||||||
return this._add(Segment.readAll(segments), index);
|
return this._add(Segment.readList(segments), index);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeSegment: function(index) {
|
removeSegment: function(index) {
|
||||||
|
@ -9282,21 +9313,30 @@ var CompoundPath = PathItem.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
insertChildren: function insertChildren(index, items, _preserve) {
|
insertChildren: function insertChildren(index, items, _preserve) {
|
||||||
|
var list = items,
|
||||||
|
first = list[0];
|
||||||
|
if (first && typeof first[0] === 'number')
|
||||||
|
list = [list];
|
||||||
for (var i = items.length - 1; i >= 0; i--) {
|
for (var i = items.length - 1; i >= 0; i--) {
|
||||||
var item = items[i];
|
var item = list[i];
|
||||||
if (item instanceof CompoundPath) {
|
if (list === items && !(item instanceof Path))
|
||||||
items = items.slice();
|
list = Base.slice(list);
|
||||||
items.splice.apply(items, [i, 1].concat(item.removeChildren()));
|
if (Array.isArray(item)) {
|
||||||
|
var path = new Path({ segments: item, insert: false });
|
||||||
|
path.setClockwise(path.isClockwise());
|
||||||
|
list[i] = path;
|
||||||
|
} else if (item instanceof CompoundPath) {
|
||||||
|
list.splice.apply(list, [i, 1].concat(item.removeChildren()));
|
||||||
item.remove();
|
item.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
items = insertChildren.base.call(this, index, items, _preserve, Path);
|
list = insertChildren.base.call(this, index, list, _preserve);
|
||||||
for (var i = 0, l = !_preserve && items && items.length; i < l; i++) {
|
for (var i = 0, l = !_preserve && list && list.length; i < l; i++) {
|
||||||
var item = items[i];
|
var item = list[i];
|
||||||
if (item._clockwise === undefined)
|
if (item._clockwise === undefined)
|
||||||
item.setClockwise(item._index === 0);
|
item.setClockwise(item._index === 0);
|
||||||
}
|
}
|
||||||
return items;
|
return list;
|
||||||
},
|
},
|
||||||
|
|
||||||
reduce: function reduce(options) {
|
reduce: function reduce(options) {
|
||||||
|
@ -10793,8 +10833,7 @@ var Color = Base.extend(new function() {
|
||||||
_readIndex: true,
|
_readIndex: true,
|
||||||
|
|
||||||
initialize: function Color(arg) {
|
initialize: function Color(arg) {
|
||||||
var slice = Array.prototype.slice,
|
var args = arguments,
|
||||||
args = arguments,
|
|
||||||
reading = this.__read,
|
reading = this.__read,
|
||||||
read = 0,
|
read = 0,
|
||||||
type,
|
type,
|
||||||
|
@ -10815,7 +10854,7 @@ var Color = Base.extend(new function() {
|
||||||
} else {
|
} else {
|
||||||
if (reading)
|
if (reading)
|
||||||
read = 1;
|
read = 1;
|
||||||
args = slice.call(args, 1);
|
args = Base.slice(args, 1);
|
||||||
argType = typeof arg;
|
argType = typeof arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10838,7 +10877,7 @@ var Color = Base.extend(new function() {
|
||||||
: 1;
|
: 1;
|
||||||
}
|
}
|
||||||
if (values.length > length)
|
if (values.length > length)
|
||||||
values = slice.call(values, 0, length);
|
values = Base.slice(values, 0, length);
|
||||||
} else if (argType === 'string') {
|
} else if (argType === 'string') {
|
||||||
type = 'rgb';
|
type = 'rgb';
|
||||||
components = fromCSS(arg);
|
components = fromCSS(arg);
|
||||||
|
@ -11180,7 +11219,7 @@ var Gradient = Base.extend({
|
||||||
for (var i = 0, l = _stops.length; i < l; i++)
|
for (var i = 0, l = _stops.length; i < l; i++)
|
||||||
_stops[i]._owner = undefined;
|
_stops[i]._owner = undefined;
|
||||||
}
|
}
|
||||||
_stops = this._stops = GradientStop.readAll(stops, 0, { clone: true });
|
_stops = this._stops = GradientStop.readList(stops, 0, { clone: true });
|
||||||
for (var i = 0, l = _stops.length; i < l; i++)
|
for (var i = 0, l = _stops.length; i < l; i++)
|
||||||
_stops[i]._owner = this;
|
_stops[i]._owner = this;
|
||||||
this._changed();
|
this._changed();
|
||||||
|
@ -12363,7 +12402,7 @@ var CanvasView = View.extend({
|
||||||
if (size.isZero())
|
if (size.isZero())
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Cannot create CanvasView with the provided argument: '
|
'Cannot create CanvasView with the provided argument: '
|
||||||
+ [].slice.call(arguments, 1));
|
+ Base.slice(arguments, 1));
|
||||||
canvas = CanvasProvider.getCanvas(size);
|
canvas = CanvasProvider.getCanvas(size);
|
||||||
}
|
}
|
||||||
var ctx = this._context = canvas.getContext('2d');
|
var ctx = this._context = canvas.getContext('2d');
|
||||||
|
|
18
dist/paper-full.min.js
vendored
18
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -72,7 +72,7 @@
|
||||||
"resemblejs": "^2.2.1",
|
"resemblejs": "^2.2.1",
|
||||||
"run-sequence": "^1.2.2",
|
"run-sequence": "^1.2.2",
|
||||||
"stats.js": "0.16.0",
|
"stats.js": "0.16.0",
|
||||||
"straps": "^2.0.1"
|
"straps": "^2.1.0"
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"canvas": false,
|
"canvas": false,
|
||||||
|
|
Loading…
Reference in a new issue