MCPcopy Create free account
hub / github.com/SpringRoll/SpringRoll / addEntity

Method addEntity

src/scale-manager/SafeScaleManager.js:153–169  ·  view source on GitHub ↗

* Adds and anchor to be updated during resize * @param {ScaledEntity | ScaledEntity[]} entity * @memberof SafeScaleManager

(entity)

Source from the content-addressed store, hash-verified

151 * @memberof SafeScaleManager
152 */
153 addEntity(entity) {
154 if (!Array.isArray(entity)) {
155 entity = [entity];
156 }
157
158 entity.forEach(e => {
159 if (this.entities.includes(e)) {
160 return;
161 }
162
163 if (this.resizeEventData) {
164 e.onResize(this.resizeEventData);
165 }
166
167 this.entities.push(e);
168 });
169 }
170
171 /**
172 * Removes an anchor

Callers 1

Calls 1

onResizeMethod · 0.65

Tested by

no test coverage detected