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对象的所有可枚举属性复制到另一个对象
这不会也不能与通用实用程序竞争。
不克隆或延伸织物。子类的对象。
这主要是内部使用,并有额外的处理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