Line selection model not working the same as in the public demo

28 views
Skip to first unread message

ChrisNewforma

unread,
Oct 14, 2014, 9:19:16 AM10/14/14
to pdfnet-w...@googlegroups.com
Hey Guys,

We are using the line tool and we've set it up to use the standard LineSelectionModel. However, the behavior is different from the public demo, so I'm wondering if you guys did some customizing on that selection model for the demo. 

We can only select the line by dragging a rectangle around the start point, or by clicking directly on the line pixels (and it is pixel perfect... no fuzz factor which would be nice). Dragging a selection box over any part of the line other than the start point will not select it.

Also, in the demo it appears that after the line is selected, it's entire bounding box is clickable in order to move the line. We are not seeing that behavior either.

Do we need to customize the selection model, or are we using the LineSelectionModel incorrectly?

Thanks!

Matt Parizeau

unread,
Oct 14, 2014, 2:18:38 PM10/14/14
to pdfnet-w...@googlegroups.com
Hi Chris,

The selection model is attached to the annotation, so for the line annotation by default: Annotatons.LineAnnotation.prototype.selectionModel = Annotations.LineSelectionModel. So if you're using a custom annotation then make sure to set the selectionModel here (which might be what you meant you were doing!).

ReaderControl.js increases the default "fuzz factor" by setting Annotations.SelectionAlgorithm.canvasVisibilityPadding = 10; (default is 5). I don't think there are other customizations besides that.

If this doesn't help then can you send the code you're using to set the selection model so I can try to reproduce the issue.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages