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

Method set

apps/image-editor/src/js/component/flip.js:35–54  ·  view source on GitHub ↗

* Set flipX, flipY * @param {{flipX: Boolean, flipY: Boolean}} newSetting - Flip setting * @returns {Promise}

(newSetting)

Source from the content-addressed store, hash-verified

33 * @returns {Promise}
34 */
35 set(newSetting) {
36 const setting = this.getCurrentSetting();
37 const isChangingFlipX = setting.flipX !== newSetting.flipX;
38 const isChangingFlipY = setting.flipY !== newSetting.flipY;
39
40 if (!isChangingFlipX && !isChangingFlipY) {
41 return Promise.reject(rejectMessages.flip);
42 }
43
44 extend(setting, newSetting);
45 this.setImageProperties(setting, true);
46 this._invertAngle(isChangingFlipX, isChangingFlipY);
47 this._flipObjects(isChangingFlipX, isChangingFlipY);
48
49 return Promise.resolve({
50 flipX: setting.flipX,
51 flipY: setting.flipY,
52 angle: this.getCanvasImage().angle,
53 });
54 }
55
56 /**
57 * Invert image angle for flip

Callers 15

resetMethod · 0.95
flipXMethod · 0.95
flipYMethod · 0.95
changeOriginFunction · 0.80
_setSelectionStyleMethod · 0.80
setImagePropertiesMethod · 0.80
setObjectPropertiesMethod · 0.80
setObjectPositionMethod · 0.80
createStaticCanvasMethod · 0.80
_onPathCreatedMethod · 0.80

Calls 5

getCurrentSettingMethod · 0.95
_invertAngleMethod · 0.95
_flipObjectsMethod · 0.95
setImagePropertiesMethod · 0.45
getCanvasImageMethod · 0.45

Tested by

no test coverage detected