[Lazarus] Looking for vectors library

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Jun 1 17:59:55 CEST 2011


On Wed, Jun 1, 2011 at 5:51 PM, Leonardo M. Ramé <l.rame at griensu.com> wrote:
> A new question. How can I check for mouse click on vectors?

There is ready-made routine for that at the moment ... contributions
are welcome =)

Basically you have to iterate through all items and check their
coordinates against the mouse ones with the appropriate conversions,
probably with an error margin of around 5 pixels.

This could be slow if the drawing has 10000s of elements, in that case
I suppose that some kind of optimization would be necessary, like the
following idea: When drawing check which elements are visible and make
a list with pointers to them. On click check only that list.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list