mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix viewport shaking on touchmove event on mobile/tablet
This commit is contained in:
parent
0b1ec655ae
commit
4895017ebb
@ -86,9 +86,10 @@
|
|||||||
window.addEventListener('mouseup', this.onMouseup_.bind(this));
|
window.addEventListener('mouseup', this.onMouseup_.bind(this));
|
||||||
window.addEventListener('mousemove', this.onMousemove_.bind(this));
|
window.addEventListener('mousemove', this.onMousemove_.bind(this));
|
||||||
window.addEventListener('keyup', this.onKeyup_.bind(this));
|
window.addEventListener('keyup', this.onKeyup_.bind(this));
|
||||||
window.addEventListener('touchstart', this.onMousedown_.bind(this));
|
window.addEventListener('touchstart', this.onTouchstart_.bind(this));
|
||||||
window.addEventListener('touchmove' , this.onMousemove_.bind(this));
|
window.addEventListener('touchmove' , this.onTouchmove_.bind(this));
|
||||||
window.addEventListener('touchend', this.onMouseup_.bind(this));
|
window.addEventListener('touchend', this.onTouchend_.bind(this));
|
||||||
|
|
||||||
// Deactivate right click:
|
// Deactivate right click:
|
||||||
body.contextmenu(this.onCanvasContextMenu_);
|
body.contextmenu(this.onCanvasContextMenu_);
|
||||||
|
|
||||||
@ -136,6 +137,19 @@
|
|||||||
$.publish(Events.ZOOM_CHANGED);
|
$.publish(Events.ZOOM_CHANGED);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ns.DrawingController.prototype.onTouchstart_ = function (event) {
|
||||||
|
this.onMousedown_(event);
|
||||||
|
};
|
||||||
|
|
||||||
|
ns.DrawingController.prototype.onTouchmove_ = function (event) {
|
||||||
|
this.onMousemove_(event);
|
||||||
|
event.preventDefault();
|
||||||
|
};
|
||||||
|
|
||||||
|
ns.DrawingController.prototype.onTouchend_ = function (event) {
|
||||||
|
this.onMouseup_(event);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user