drag
This commit is contained in:
parent
5b81962869
commit
338323c748
@ -388,7 +388,7 @@ editor.prototype.HTMLescape = function (str_) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editor.prototype.listen = function () {
|
editor.prototype.listen = function () {
|
||||||
|
var eui=document.getElementById('eui');
|
||||||
var uc = eui.getContext('2d');
|
var uc = eui.getContext('2d');
|
||||||
|
|
||||||
function fillPos(pos) {
|
function fillPos(pos) {
|
||||||
@ -399,9 +399,11 @@ editor.prototype.listen = function () {
|
|||||||
function eToLoc(e) {
|
function eToLoc(e) {
|
||||||
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
|
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
|
||||||
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop
|
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop
|
||||||
|
var xx=e.clientX,yy=e.clientY
|
||||||
|
if(editor.isMobile){xx=e.touches[0].clientX,yy=e.touches[0].clientY}
|
||||||
editor.loc = {
|
editor.loc = {
|
||||||
'x': scrollLeft + e.clientX - mid.offsetLeft - mapEdit.offsetLeft,
|
'x': scrollLeft + xx - mid.offsetLeft - mapEdit.offsetLeft,
|
||||||
'y': scrollTop + e.clientY - mid.offsetTop - mapEdit.offsetTop,
|
'y': scrollTop + yy - mid.offsetTop - mapEdit.offsetTop,
|
||||||
'size': editor.isMobile?(32*innerWidth*0.96/416):32
|
'size': editor.isMobile?(32*innerWidth*0.96/416):32
|
||||||
};
|
};
|
||||||
return editor.loc;
|
return editor.loc;
|
||||||
@ -499,7 +501,6 @@ editor.prototype.listen = function () {
|
|||||||
}
|
}
|
||||||
holdingPath = 0;
|
holdingPath = 0;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
var loc = eToLoc(e);
|
|
||||||
if (stepPostfix && stepPostfix.length) {
|
if (stepPostfix && stepPostfix.length) {
|
||||||
preMapData = JSON.parse(JSON.stringify(editor.map));
|
preMapData = JSON.parse(JSON.stringify(editor.map));
|
||||||
currDrawData.pos = JSON.parse(JSON.stringify(stepPostfix));
|
currDrawData.pos = JSON.parse(JSON.stringify(stepPostfix));
|
||||||
|
|||||||
@ -503,10 +503,20 @@ var editor_mobile_listen=function(){
|
|||||||
printf(info[0].children[1].getAttribute('title'))
|
printf(info[0].children[1].getAttribute('title'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=====
|
||||||
|
|
||||||
document.body.ontouchstart=document.body.onmousedown;
|
document.body.ontouchstart=document.body.onmousedown;
|
||||||
document.body.onmousedown=null;
|
document.body.onmousedown=null;
|
||||||
|
|
||||||
//=====
|
|
||||||
|
var eui=document.getElementById('eui');
|
||||||
|
eui.ontouchstart=eui.onmousedown
|
||||||
|
eui.onmousedown=null
|
||||||
|
eui.ontouchmove=eui.onmousemove
|
||||||
|
eui.onmousemove=null
|
||||||
|
eui.ontouchend=eui.onmouseup
|
||||||
|
eui.onmouseup=null
|
||||||
|
|
||||||
|
|
||||||
var chooseThis = document.getElementById('chooseThis');
|
var chooseThis = document.getElementById('chooseThis');
|
||||||
chooseThis.ontouchstart=chooseThis.onmousedown
|
chooseThis.ontouchstart=chooseThis.onmousedown
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user