Skip to content

Commit

Permalink
Duh
Browse files Browse the repository at this point in the history
  • Loading branch information
rberenguel committed Nov 30, 2024
1 parent bd44be9 commit 189b699
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,41 @@ class Image {
pastedImage.setAttribute("x", this.x);
pastedImage.setAttribute("y", this.y);
});

const here = this;

interact(pastedImage).draggable({
inertia: true,
autoscroll: true,
listeners: {
leave: (ev) => {},
start(ev) {
here.dragInit();
},
end(ev) {
here.dragOff();
},
move(ev) {
here.drag(ev);
},
},
});

interact(pastedImage).gesturable({
listeners: {
move(ev) {
if (options.noGestures) {
return;
}
// Scale > 1 is opening up
// Scale < 1 is closing
// TODO(check and work on this)
here._scale = ev.scale;
here.scale();
},
},
});

return pastedImage;
}

Expand Down

0 comments on commit 189b699

Please sign in to comment.