Re: [cairo] Hit detect surface?
- From: Leon Woestenberg <leonw mailcan com>
- To: Bill Spitzak <spitzak d2 com>
- Cc: Sven Herzberg <herzi gnome-de org>, cairo cairographics org, vladimir pobox com, Havoc Pennington <hp redhat com>, "Gustavo J. A. M. Carneiro" <gjc inescporto pt>, gtk-devel-list gnome org
- Subject: Re: [cairo] Hit detect surface?
- Date: Thu, 02 Mar 2006 00:31:32 +0100
Hello all,
Bill Spitzak wrote:
To find the nearest, you must draw several times, with smaller and
smaller squares, until either you reach a minimum size, or only one
object is detected (or it goes to zero, in which case you use the
previous pass). (actually now that I think about it, it may be more
efficient to start at the minimum size and go up until you hit
something.)
Can a 'binary search' algorithm be even more speedy in this regard?
test a middle sized square, if hit detected halve the square size, else
double square size, repeat and rinse.
Regards,
Leon.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]