Replies: 1 comment 1 reply
-
@chitgoks I am using interactjs for handling click, drag and resize events for annotations. interact('.freeTextAnnotation')
.resizable({
edges: {
top: '.resize-top',
left: '.resize-left',
right: '.resize-right',
bottom: '.resize-bottom',
},
listeners: {move: handleResize.resizeInteractionListener},
modifiers: [
// keep the edges inside the parent
interact.modifiers.restrictEdges({
outer: '.page'
}),
interact.modifiers.restrictSize({
min: {width: 20, height: 10},
}),
],
inertia: true
})
.draggable({
listeners: {move: handleDrag.dragMoveListener},
modifiers: [
interact.modifiers.restrictRect({
restriction: '.page',
endOnly: true
})
]
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. i reached a dead end regarding this. I have a case scenario where i add a new canvas layer on the pdf.js page itself. But i also want to check if the mouse cursor is on top of an annotation.
This is my code on how to get annotations of a page
and this is my code to check if the mouse cursor is on top of the annotation. Now i am aware the pdf coordinate y space is the opposite, so i made a function that will convert it to the html canvas space plus the annotation.rect returns [x1,y1,x2,y2] right?
im not sure what is wrong. anyone got ideas?
Beta Was this translation helpful? Give feedback.
All reactions