On Wed, Jun 1, 2011 at 5:51 PM, Leonardo M. Ramé <[email protected]> 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

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to