Archived
1
0

use screenX/y instead of clientX/y

This commit is contained in:
Jeff
2016-05-03 12:38:46 -04:00
parent 7afd47805a
commit 7daa0f8520
2 changed files with 5 additions and 5 deletions

View File

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