use screenX/y instead of clientX/y
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user