MCPcopy
hub / github.com/nhn/tui.image-editor / execute

Function execute

apps/image-editor/src/js/command/setObjectPosition.js:18–32  ·  view source on GitHub ↗

* Set object properties * @param {Graphics} graphics - Graphics instance * @param {number} id - object id * @param {Object} posInfo - position object * @param {number} posInfo.x - x position * @param {number} posInfo.y - y position * @param {string} posInfo.originX - can be 'lef

(graphics, id, posInfo)

Source from the content-addressed store, hash-verified

16 * @returns {Promise}
17 */
18 execute(graphics, id, posInfo) {
19 const targetObj = graphics.getObject(id);
20
21 if (!targetObj) {
22 return Promise.reject(rejectMessages.noObject);
23 }
24
25 this.undoData.objectId = id;
26 this.undoData.props = graphics.getObjectProperties(id, ['left', 'top']);
27
28 graphics.setObjectPosition(id, posInfo);
29 graphics.renderAll();
30
31 return Promise.resolve();
32 },
33
34 /**
35 * @param {Graphics} graphics - Graphics instance

Callers

nothing calls this directly

Calls 4

getObjectMethod · 0.80
renderAllMethod · 0.80
getObjectPropertiesMethod · 0.45
setObjectPositionMethod · 0.45

Tested by

no test coverage detected