Archived
1
0

revert to clientX/Y

This commit is contained in:
Jeff
2016-05-03 13:01:55 -04:00
parent be7831cd10
commit 3fb94baaca
2 changed files with 5 additions and 5 deletions

View File

@@ -363,16 +363,16 @@ function init(prefix) {
e.addEventListener("dragstart", function(ev) {
console.log(ev);
mouseDownX = ev.screenX;
mouseDownY = ev.screenY;
mouseDownX = ev.clientX;
mouseDownY = ev.clientY;
if(!ev.shiftKey) {
ev.preventDefault();
}
}, false);
e.addEventListener("dragend", function(ev) {
var x = originalX + ev.screenX - mouseDownX;
var y = originalY + ev.screenY - mouseDownY;
var x = originalX + ev.clientX - mouseDownX;
var y = originalY + ev.clientY - mouseDownY;
x -= window.screenLeft;
y -= window.screenTop;
rpl.moveTo(x, y);