require('../../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages_tool/pages/christmasHat/imageeditor/imageeditor"],{579:function(t,e,n){"use strict";(function(t,e){var a=n(4);n(26);a(n(25));var r=a(n(580));t.__webpack_require_UNI_MP_PLUGIN__=n,e(r.default)}).call(this,n(1)["default"],n(2)["createPage"])},580:function(t,e,n){"use strict";n.r(e);var a=n(581),r=n(583);for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n(595);var h,c=n(34),s=Object(c["default"])(r["default"],a["render"],a["staticRenderFns"],!1,null,null,null,!1,a["components"],h);s.options.__file="pages_tool/pages/christmasHat/imageeditor/imageeditor.vue",e["default"]=s.exports},581:function(t,e,n){"use strict";n.r(e);var a=n(582);n.d(e,"render",(function(){return a["render"]})),n.d(e,"staticRenderFns",(function(){return a["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return a["recyclableRender"]})),n.d(e,"components",(function(){return a["components"]}))},582:function(t,e,n){"use strict";var a;n.r(e),n.d(e,"render",(function(){return r})),n.d(e,"staticRenderFns",(function(){return h})),n.d(e,"recyclableRender",(function(){return i})),n.d(e,"components",(function(){return a}));var r=function(){var t=this,e=t.$createElement;t._self._c},i=!1,h=[];r._withStripped=!0},583:function(t,e,n){"use strict";n.r(e);var a=n(584),r=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=r.a},584:function(t,e,n){"use strict";(function(t){var a=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(585)),i=a(n(586)),h=a(n(587)),c=a(n(588)),s=a(n(589)),l=a(n(590)),o=a(n(591)),u=a(n(592)),d=a(n(593)),_=a(n(594)),f=getApp(),C={data:function(){return{bgPic:null,imgList:[r.default,i.default,h.default,c.default,s.default,l.default,o.default,u.default,d.default,_.default],currentHatId:1,currentHatSrc:r.default,hatCenterX:t.getSystemInfoSync().windowWidth/2,hatCenterY:150,cancelCenterX:t.getSystemInfoSync().windowWidth/2-50-2,cancelCenterY:100,handleCenterX:t.getSystemInfoSync().windowWidth/2+50-2,handleCenterY:200,hatSize:100,scale:1,rotate:0,combine:""}},onLoad:function(){this.bgPic=f.globalData.bgPic},onReady:function(){this.hat_center_x=this.hatCenterX,this.hat_center_y=this.hatCenterY,this.cancel_center_x=this.cancelCenterX,this.cancel_center_y=this.cancelCenterY,this.handle_center_x=this.handleCenterX,this.handle_center_y=this.handleCenterY,this.scale=this.scale,this.rotate=this.rotate,this.touch_target="",this.start_x=0,this.start_y=0},methods:{touchStart:function(t){"hat"==t.target.id?this.touch_target="hat":"handle"==t.target.id?this.touch_target="handle":this.touch_target="",""!=this.touch_target&&(this.start_x=t.touches[0].clientX,this.start_y=t.touches[0].clientY)},touchEnd:function(t){this.hat_center_x=this.hatCenterX,this.hat_center_y=this.hatCenterY,this.cancel_center_x=this.cancelCenterX,this.cancel_center_y=this.cancelCenterY,this.handle_center_x=this.handleCenterX,this.handle_center_y=this.handleCenterY,this.touch_target="",this.scale=this.scale,this.rotate=this.rotate},touchMove:function(t){var e=t.touches[0].clientX,n=t.touches[0].clientY,a=e-this.start_x,r=n-this.start_y;if("hat"==this.touch_target&&(this.hatCenterX=this.hatCenterX+a,this.hatCenterY=this.hatCenterY+r,this.cancelCenterX=this.cancelCenterX+a,this.cancelCenterY=this.cancelCenterY+r,this.handleCenterX=this.handleCenterX+a,this.handleCenterY=this.handleCenterY+r),"handle"==this.touch_target){this.handleCenterX=this.handleCenterX+a,this.handleCenterY=this.handleCenterY+r,this.cancelCenterX=2*this.hatCenterX-this.handleCenterX,this.cancelCenterY=2*this.hatCenterY-this.handleCenterY;var i=this.handle_center_x-this.hat_center_x,h=this.handle_center_y-this.hat_center_y,c=this.handleCenterX-this.hat_center_x,s=this.handleCenterY-this.hat_center_y,l=Math.sqrt(i*i+h*h),o=Math.sqrt(c*c+s*s),u=Math.atan2(h,i)/Math.PI*180,d=Math.atan2(s,c)/Math.PI*180;this.scale=o/l*this.scale,this.rotate=d-u+this.rotate}this.start_x=e,this.start_y=n},chooseImg:function(t){this.currentHatId=t+1,this.currentHatSrc=this.imgList[t]},combinePic:function(){f.globalData.scale=this.scale,f.globalData.rotate=this.rotate,f.globalData.hat_center_x=this.hat_center_x,f.globalData.hat_center_y=this.hat_center_y,f.globalData.currentHatId=this.currentHatId,f.globalData.currentHatSrc=this.currentHatSrc,t.navigateTo({url:"../combine/combine"})}}};e.default=C}).call(this,n(2)["default"])},595:function(t,e,n){"use strict";n.r(e);var a=n(596),r=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=r.a},596:function(t,e,n){}},[[579,"common/runtime","common/vendor","pages_tool/common/vendor"]]]);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages_tool/pages/christmasHat/imageeditor/imageeditor.js.map