Define Curve#_serialize()

This commit is contained in:
Jürg Lehni 2015-08-28 16:18:28 +02:00
parent e07d8f55ea
commit 0cbce044aa

View file

@ -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;