MCPcopy
hub / github.com/fabricjs/fabric.js / set

Method set

src/CommonMethods.ts:29–36  ·  view source on GitHub ↗

* Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`. * @param {String|Object} key Property name or object (if object, ite

(key: string | Record<string, any>, value?: any)

Source from the content-addressed store, hash-verified

27 * @param {Object|Function} value Property value (if function, the value is passed into it and its return value is used as a new one)
28 */
29 set(key: string | Record<string, any>, value?: any) {
30 if (typeof key === 'object') {
31 this._setObject(key);
32 } else {
33 this._set(key, value);
34 }
35 return this;
36 }
37
38 _set(key: string, value: any) {
39 this[key as keyof this] = value;

Callers 15

_setOptionsMethod · 0.95
toggleMethod · 0.95
line.jsFile · 0.45
object.jsFile · 0.45
testFractionDigitsFunction · 0.45
group.jsFile · 0.45
updatePathFunction · 0.45
path.jsFile · 0.45
itext.jsFile · 0.45
text.jsFile · 0.45
canvas_static.jsFile · 0.45

Calls 2

_setObjectMethod · 0.95
_setMethod · 0.95

Tested by

no test coverage detected