RavishaHesh / PDFJsAnnotations

Wrapper for PDF JS to add annotations
MIT License
333 stars 99 forks source link

better click handler #49

Open mankowitz opened 2 years ago

mankowitz commented 2 years ago

When creating rectangles, it is counterintuitive that if the rectangle tool is selected and I try to resize or move another object, it will draw another rectangle. This only triggers the handler if it is a plain click.

RavishaHesh commented 2 years ago

@mankowitz thanks for the PR. I think with one small change we can do a bit of cleanup to the code. Instead of Math functions, we can use Fabric's http://fabricjs.com/docs/fabric.Point.html#distanceFrom function to calculate the distance between points. I'll test this a little bit and merge it with the change. Thanks again.