Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Polyline Tolerance

A another (slightly different) approach may be to subclass polyline and change containsPoint and lineContainsPoint to use your new dynamic tolerance field. If you do this, you will have to change points to getPoints(), but other than this, it should work. This also means that your new Shape *is* a polyline. Although I do agree it would be nice to set this in the polyline.

cheers,
ian

Manuel SELVA wrote:
Hi all,

I am writing an application using Draw2d and dealing with a lot of Polylines. I need to provide to the user a way to click on these polylines to display informations. Adding a MouseListener on the polyline works fine but the user must click exactly on the polyline (+- the TOLERANCE field set to 2 pixel). I would like to increase this tolerance and the only way i found is to copy the Polyline source code to create my own Line figure and change the TOLERANCE field value.
Is there an other cleaner and safe way i miss to change this tolerance ?
Is it possible to have a convenience method on polyline allowing to change this TOLERANCE ?

Thanks

Manu

_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev



Back to the top