mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Define Curve#_serialize()
This commit is contained in:
parent
e07d8f55ea
commit
0cbce044aa
1 changed files with 9 additions and 0 deletions
|
@ -97,6 +97,15 @@ var Curve = Base.extend(/** @lends Curve# */{
|
|||
}
|
||||
},
|
||||
|
||||
_serialize: function(options) {
|
||||
// If it is straight, only serialize point, otherwise handles too.
|
||||
return Base.serialize(this.isStraight()
|
||||
? [this.getPoint1(), this.getPoint2()]
|
||||
: [this.getPoint1(), this.getHandle1(), this.getHandle2(),
|
||||
this.getPoint2()],
|
||||
options, true);
|
||||
},
|
||||
|
||||
_changed: function() {
|
||||
// Clear cached values.
|
||||
this._length = this._bounds = undefined;
|
||||
|
|
Loading…
Reference in a new issue