check for mouse start on mouse end

This commit is contained in:
Stewart Allen 2020-07-03 22:07:45 -04:00
commit d7ab9c93d6

View file

@ -505,7 +505,7 @@
x: (event.clientX / width()) * 2 - 1,
y: -(event.clientY / height()) * 2 + 1};
// only fire on mouse move between mouseStart (down) and up
if (mouseEnd.x - mouseStart.x + mouseEnd.y - mouseStart.y === 0) {
if (mouseStart && mouseEnd.x - mouseStart.x + mouseEnd.y - mouseStart.y === 0) {
event.preventDefault();
let refresh = false,
selection = null;
@ -523,6 +523,7 @@
platformClick(platformClickAt);
}
if (refresh) requestRefresh();
mouseStart = null;
} else if (mouseDrag && mouseDragStart) {
mouseDrag(null,null,true);
}