Created
August 27, 2019 09:20
-
-
Save rowan-m/10f4b14e90437be6c7ab70b8f94e9bee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_onTouchstart(e) { | |
e.preventDefault(); | |
this._touchX = e.changedTouches[0].clientX; | |
this._touchY = e.changedTouches[0].clientY; | |
this._rotationStart(); | |
this.addEventListener('touchmove', this._onTouchmove); | |
this.addEventListener('touchend', this._onTouchend); | |
this.addEventListener('touchcancel', this._onTouchend); | |
} | |
_onTouchmove(e) { | |
e.preventDefault(); | |
this._touchX = e.targetTouches[0].clientX; | |
this._touchY = e.targetTouches[0].clientY; | |
this._rotationChange(); | |
} | |
_onTouchend(e) { | |
e.preventDefault(); | |
this.removeEventListener('touchmove', this._onTouchmove); | |
this.removeEventListener('touchend', this._onTouchend); | |
this.removeEventListener('touchcancel', this._onTouchend); | |
this._rotationEnd(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment