* 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)
| 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 |
nothing calls this directly
no test coverage detected