e2a5b80b8729038040ee8d31c6131da6.json 3 KB
{"ast":null,"code":"/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Flip an image\r\n */\nimport commandFactory from '../factory/command';\nimport { componentNames, commandNames } from '../consts';\nconst {\n  FLIP\n} = componentNames;\nconst command = {\n  name: commandNames.FLIP_IMAGE,\n\n  /**\r\n   * flip an image\r\n   * @param {Graphics} graphics - Graphics instance\r\n   * @param {string} type - 'flipX' or 'flipY' or 'reset'\r\n   * @returns {Promise}\r\n   */\n  execute(graphics, type) {\n    const flipComp = graphics.getComponent(FLIP);\n    this.undoData.setting = flipComp.getCurrentSetting();\n    return flipComp[type]();\n  },\n\n  /**\r\n   * @param {Graphics} graphics - Graphics instance\r\n   * @returns {Promise}\r\n   */\n  undo(graphics) {\n    const flipComp = graphics.getComponent(FLIP);\n    return flipComp.set(this.undoData.setting);\n  }\n\n};\ncommandFactory.register(command);\nexport default command;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/src/js/command/flip.js"],"names":["commandFactory","componentNames","commandNames","FLIP","command","name","FLIP_IMAGE","execute","graphics","type","flipComp","getComponent","undoData","setting","getCurrentSetting","undo","set","register"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,oBAA3B;AACA,SAASC,cAAT,EAAyBC,YAAzB,QAA6C,WAA7C;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWF,cAAjB;AAEA,MAAMG,OAAO,GAAG;AACdC,EAAAA,IAAI,EAAEH,YAAY,CAACI,UADL;;AAGd;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,OAAO,CAACC,QAAD,EAAWC,IAAX,EAAiB;AACtB,UAAMC,QAAQ,GAAGF,QAAQ,CAACG,YAAT,CAAsBR,IAAtB,CAAjB;AAEA,SAAKS,QAAL,CAAcC,OAAd,GAAwBH,QAAQ,CAACI,iBAAT,EAAxB;AAEA,WAAOJ,QAAQ,CAACD,IAAD,CAAR,EAAP;AACD,GAfa;;AAgBd;AACF;AACA;AACA;AACEM,EAAAA,IAAI,CAACP,QAAD,EAAW;AACb,UAAME,QAAQ,GAAGF,QAAQ,CAACG,YAAT,CAAsBR,IAAtB,CAAjB;AAEA,WAAOO,QAAQ,CAACM,GAAT,CAAa,KAAKJ,QAAL,CAAcC,OAA3B,CAAP;AACD;;AAxBa,CAAhB;AA2BAb,cAAc,CAACiB,QAAf,CAAwBb,OAAxB;AAEA,eAAeA,OAAf","sourcesContent":["/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Flip an image\r\n */\r\nimport commandFactory from '../factory/command';\r\nimport { componentNames, commandNames } from '../consts';\r\n\r\nconst { FLIP } = componentNames;\r\n\r\nconst command = {\r\n  name: commandNames.FLIP_IMAGE,\r\n\r\n  /**\r\n   * flip an image\r\n   * @param {Graphics} graphics - Graphics instance\r\n   * @param {string} type - 'flipX' or 'flipY' or 'reset'\r\n   * @returns {Promise}\r\n   */\r\n  execute(graphics, type) {\r\n    const flipComp = graphics.getComponent(FLIP);\r\n\r\n    this.undoData.setting = flipComp.getCurrentSetting();\r\n\r\n    return flipComp[type]();\r\n  },\r\n  /**\r\n   * @param {Graphics} graphics - Graphics instance\r\n   * @returns {Promise}\r\n   */\r\n  undo(graphics) {\r\n    const flipComp = graphics.getComponent(FLIP);\r\n\r\n    return flipComp.set(this.undoData.setting);\r\n  },\r\n};\r\n\r\ncommandFactory.register(command);\r\n\r\nexport default command;\r\n"]},"metadata":{},"sourceType":"module"}