Methods
(static) clone(object, deepopt) → {Object}
Creates an empty object and copies all enumerable properties of another object to it
This method is mostly for internal use, and not intended for duplicating shapes in canvas.
创建一个空对象,并将另一个对象的所有可枚举属性复制到该对象
此方法主要用于内部使用,不用于在画布中复制形状。
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
object |
Object | Object to clone反对克隆 | |
deep |
Boolean |
<optional> |
Whether to clone nested objects是否克隆嵌套对象 |
Returns:
- Type
- Object
(static) extend(destination, source, deepopt) → {Object}
Copies all enumerable properties of one js object to another
this does not and cannot compete with generic utils.
Does not clone or extend fabric.Object subclasses.
This is mostly for internal use and has extra handling for fabricJS objects
it skips the canvas and group properties in deep cloning.
将一个js对象的所有可枚举属性复制到另一个js对象
它没有也不能与通用utils竞争。
不能克隆或延伸织物。子类的对象。
这主要用于内部使用,对fabricJS对象有额外的处理
它在深度克隆中跳过画布和组属性。
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
destination |
Object | Where to copy to复制到哪里 | |
source |
Object | Where to copy from从哪里复制 | |
deep |
Boolean |
<optional> |
Whether to extend nested objects是否扩展嵌套对象 |
Returns:
- Type
- Object