From 0cbce044aaf47e9cdf975f4788209f80315b5c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 28 Aug 2015 16:18:28 +0200 Subject: [PATCH] Define Curve#_serialize() --- src/path/Curve.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/path/Curve.js b/src/path/Curve.js index eb0bdd23..ab581585 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -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;