Include pathOffset in fabric.Path.toObject()

Include pathOffset in toObject() of fabric.Path and use it (if defined) in _initializePath().
This should fix issue #500.
This commit is contained in:
Kienz 2013-03-28 16:07:00 +01:00
parent 45d54d9fac
commit 0b078cd4be

View file

@ -229,7 +229,7 @@
this.left = this.width / 2;
}
}
this.pathOffset = this._calculatePathOffset(isTopSet || isLeftSet); //Save top-left coords as offset
this.pathOffset = this.pathOffset || this._calculatePathOffset(isTopSet || isLeftSet); //Save top-left coords as offset
},
/**
@ -607,7 +607,8 @@
*/
toObject: function(propertiesToInclude) {
var o = extend(this.callSuper('toObject', propertiesToInclude), {
path: this.path
path: this.path,
pathOffset: this.pathOffset
});
if (this.sourcePath) {
o.sourcePath = this.sourcePath;