mobile and desktop fix
This commit is contained in:
parent
d28b0e898b
commit
58779f7f86
1 changed files with 10 additions and 12 deletions
22
js/core.js
22
js/core.js
|
@ -33,6 +33,14 @@ function Canvas(width, height, upscale) {
|
||||||
that.pageY = e.touches[0].pageY;
|
that.pageY = e.touches[0].pageY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function unclicker(e) {
|
||||||
|
that.clicked = false;
|
||||||
|
|
||||||
|
that.firstX = this.pageX;
|
||||||
|
that.firstY = this.pageY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.elem.addEventListener('mousedown', function (e) {
|
this.elem.addEventListener('mousedown', function (e) {
|
||||||
that.clicked = true;
|
that.clicked = true;
|
||||||
});
|
});
|
||||||
|
@ -57,19 +65,9 @@ function Canvas(width, height, upscale) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
})
|
})
|
||||||
|
|
||||||
this.elem.addEventListener('mouseup', function (e) {
|
this.elem.addEventListener('mouseup', unclicker);
|
||||||
that.clicked = false;
|
|
||||||
|
|
||||||
that.firstX = this.pageX;
|
this.elem.addEventListener('touchend',unclicker);
|
||||||
that.firstY = this.pageY;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.elem.addEventListener('touchend', function (e) {
|
|
||||||
that.clicked = false;
|
|
||||||
|
|
||||||
that.firstX = this.pageX;
|
|
||||||
that.firstY = this.pageY;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
this.clicked = false;
|
this.clicked = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue