You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
4.0 KiB

{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport Hammer from '@egjs/hammerjs';\nimport { DEG_RAD } from \"./constants\";\nimport IndiscreteGestureHandler from \"./IndiscreteGestureHandler\";\nvar RotationGestureHandler = function (_IndiscreteGestureHan) {\n _inherits(RotationGestureHandler, _IndiscreteGestureHan);\n var _super = _createSuper(RotationGestureHandler);\n function RotationGestureHandler() {\n _classCallCheck(this, RotationGestureHandler);\n return _super.apply(this, arguments);\n }\n _createClass(RotationGestureHandler, [{\n key: \"name\",\n get: function get() {\n return 'rotate';\n }\n }, {\n key: \"NativeGestureClass\",\n get: function get() {\n return Hammer.Rotate;\n }\n }, {\n key: \"transformNativeEvent\",\n value: function transformNativeEvent(_ref) {\n var rotation = _ref.rotation,\n velocity = _ref.velocity,\n center = _ref.center;\n var _this$initialRotation;\n return {\n rotation: (rotation - ((_this$initialRotation = this.initialRotation) !== null && _this$initialRotation !== void 0 ? _this$initialRotation : 0)) * DEG_RAD,\n anchorX: center.x,\n anchorY: center.y,\n velocity: velocity\n };\n }\n }]);\n return RotationGestureHandler;\n}(IndiscreteGestureHandler);\nexport default RotationGestureHandler;","map":{"version":3,"sources":["RotationGestureHandler.ts"],"names":["Hammer","DEG_RAD","IndiscreteGestureHandler","RotationGestureHandler","name","NativeGestureClass","Rotate","transformNativeEvent","rotation","velocity","center","initialRotation","anchorX","x","anchorY","y"],"mappings":";;;;;;;AAAA,OAAOA,MAAP,MAAmB,gBAAnB;AAEA,SAASC,OAAT;AAEA,OAAOC,wBAAP;AAAA,IAEMC,sBAAN;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,KACMC,eAAO;MACT,OAAO,QAAP;IACD;EAAA;IAAA;IAAA,KAEGC,eAAqB;MACvB,OAAOL,MAAM,CAACM,MAAd;IACD;EAAA;IAAA;IAAA,OAEDC,oCAAqE;MAAA,IAA9CC,QAAF,QAAEA,QAAF;QAAYC,QAAZ,QAAYA,QAAZ;QAAsBC,MAAAA,QAAAA,MAAAA;MAA0B,IAAA,qBAAA;MACnE,OAAO;QACLF,QAAQ,EAAE,CAACA,QAAQ,IAAA,CAAA,qBAAA,GAAI,IAAA,CAAKG,eAAT,MAAA,IAAA,IAAA,qBAAA,KAAA,KAAA,CAAA,GAAA,qBAAA,GAA4B,CAA5B,CAAT,IAA2CV,OADhD;QAELW,OAAO,EAAEF,MAAM,CAACG,CAFX;QAGLC,OAAO,EAAEJ,MAAM,CAACK,CAHX;QAILN,QAAAA,EAAAA;MAJK,CAAP;IAMD;EAAA;EAAA;AAAA,EAhBkCP,wBAArC;AAkBA,eAAeC,sBAAf","sourcesContent":["import Hammer from '@egjs/hammerjs';\n\nimport { DEG_RAD } from './constants';\nimport { HammerInputExt } from './GestureHandler';\nimport IndiscreteGestureHandler from './IndiscreteGestureHandler';\n\nclass RotationGestureHandler extends IndiscreteGestureHandler {\n get name() {\n return 'rotate';\n }\n\n get NativeGestureClass() {\n return Hammer.Rotate;\n }\n\n transformNativeEvent({ rotation, velocity, center }: HammerInputExt) {\n return {\n rotation: (rotation - (this.initialRotation ?? 0)) * DEG_RAD,\n anchorX: center.x,\n anchorY: center.y,\n velocity,\n };\n }\n}\nexport default RotationGestureHandler;\n"]},"metadata":{},"sourceType":"module"}