Skip to content

Instantly share code, notes, and snippets.

@rowan-m
Created August 27, 2019 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rowan-m/79baefa09dd751ac1ab5411806e27bc6 to your computer and use it in GitHub Desktop.
Save rowan-m/79baefa09dd751ac1ab5411806e27bc6 to your computer and use it in GitHub Desktop.
_onMousedown(e) {
this._touchX = e.clientX;
this._touchY = e.clientY;
this._rotationStart();
document.addEventListener('mousemove', this._onMousemove);
document.addEventListener('mouseup', this._onMouseup);
}
_onMousemove(e) {
e.preventDefault();
this._touchX = e.clientX;
this._touchY = e.clientY;
this._rotationChange();
}
_onMouseup(e) {
e.preventDefault();
document.removeEventListener('mousemove', this._onMousemove);
document.removeEventListener('mouseup', this._onMouseup);
this._rotationEnd();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment