Skip to content

Commit

Permalink
Update mouseEventListeners.js
Browse files Browse the repository at this point in the history
Fixed deltaPoints always 0 bug
  • Loading branch information
zhangjindong authored Apr 15, 2022
1 parent 95c3b7c commit c216a33
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/eventListeners/mouseEventListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,25 @@ function mouseMove(e) {
startPoints.image
);

let lastPoints = copyPoints(startPoints);
let lastPoints = {
page: { x: e.pageX - e.movementX, y: e.pageY - e.movementY },
image: external.cornerstone.pageToPixel(
element,
e.pageX - e.movementX,
e.pageY - e.movementY
),
client: {
x: e.clientX - e.movementX,
y: e.clientY - e.movementY,
},
};

lastPoints.canvas = external.cornerstone.pixelToCanvas(
element,
lastPoints.image
);



// Calculate our current points in page and image coordinates
const currentPoints = {
Expand Down

0 comments on commit c216a33

Please sign in to comment.