增加自定义对象属性
<pre><code>// 给对象增加自定义属性
fabric.Object.prototype.toObject = (function (toObject) {
return function (properties) {
return fabric.util.object.extend(toObject.call(this, properties), {
// 在此增加更多自定义属性...
name: this.name || '',
})
}
})(fabric.Object.prototype.toObject)</code></pre>