Skip to content

Commit

Permalink
fix: update when pointer is up
Browse files Browse the repository at this point in the history
  • Loading branch information
vaheqelyan committed Jun 7, 2021
1 parent 138d270 commit f590ad8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/MoveResize/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@
});
};
let repaint = (cb, eventType) => {
let repaint = (cb, isPointerUp) => {
dispatch("repaint", {
id,
shadow,
eventType,
isPointerUp,
onUpdate: cb,
});
};
Expand Down Expand Up @@ -269,7 +269,7 @@
window.removeEventListener("pointerdown", pointerdown);
window.removeEventListener("pointermove", pointermove);
window.removeEventListener("pointerup", pointerup);
repaint(inActivate, "pointerup");
repaint(inActivate, true);
};
// Resize
Expand Down Expand Up @@ -325,7 +325,7 @@
const resizePointerUp = (e) => {
e.stopPropagation();
repaint(inActivate);
repaint(inActivate, true);
window.removeEventListener("pointermove", resizePointerMove);
window.removeEventListener("pointerup", resizePointerUp);
Expand Down
2 changes: 1 addition & 1 deletion src/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
const throttleMatrix = throttle(updateMatrix, throttleResize);
const handleRepaint = ({ detail }) => {
if (!detail.eventType) {
if (!detail.isPointerUp) {
throttleMatrix({ detail });
} else {
updateMatrix({ detail });
Expand Down

0 comments on commit f590ad8

Please sign in to comment.