mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Define Curve#toString() and Curve#clone()
This commit is contained in:
parent
f98de38451
commit
e19c3bf3c2
1 changed files with 14 additions and 0 deletions
|
@ -148,6 +148,20 @@ var Curve = this.Curve = Base.extend({
|
|||
if (!result)
|
||||
throw new Error('Nesting capacity exceeded in computing arctime');
|
||||
return -result.b;
|
||||
},
|
||||
|
||||
clone: function() {
|
||||
return new Curve(this._segment1, this._segment2);
|
||||
},
|
||||
|
||||
toString: function() {
|
||||
return '{ point1: ' + this._segment1._point
|
||||
+ (!this._segment1._handleOut.isZero()
|
||||
? ', handle1: ' + this._segment1._handleOut : '')
|
||||
+ (this._segment2._handleIn.isZero()
|
||||
? ', handle2: ' + this._segment2._handleIn : '')
|
||||
+ ', point2: ' + this._segment2._point
|
||||
+ ' }';
|
||||
}
|
||||
}, new function() {
|
||||
function evaluate(that, t, type) {
|
||||
|
|
Loading…
Reference in a new issue