Permalink
Browse files

Emit deltaX/Y and diffX/Y values for mousemove events, too

  • Loading branch information...
davidaurelio committed Feb 22, 2013
1 parent b61c9f3 commit daaac9903c27b538ad9c2a5e8ef58812deb95d91
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/renderer/svg/svg_event_handlers.js
@@ -205,6 +205,11 @@ define([
break;
case 'mousemove':
+ event.diffX = clientX - start[0];
+ event.diffY = clientY - start[1];
+ event.deltaX = clientX - last[0];
+ event.deltaY = clientY - last[1];
+
// Regular mousemove event (not dragging)
(event = cloneBasicEvent(event)).type = 'pointermove';
this.emit('userevent', event, targetId);
@@ -213,10 +218,6 @@ define([
this.emit('userevent', event, targetId);
targetId = data._dragId;
- event.diffX = clientX - start[0];
- event.diffY = clientY - start[1];
- event.deltaX = clientX - last[0];
- event.deltaY = clientY - last[1];
if (targetId !== null) {
type = 'drag';
} else {

0 comments on commit daaac99

Please sign in to comment.