Re: [cairo] Hit detect surface?
- From: Bill Spitzak <spitzak d2 com>
- To: vladimir pobox com
- Cc: Sven Herzberg <herzi gnome-de org>, cairo cairographics org, gtk-devel-list gnome org, Havoc Pennington <hp redhat com>, "Gustavo J. A. M. Carneiro" <gjc inescporto pt>
- Subject: Re: [cairo] Hit detect surface?
- Date: Wed, 01 Mar 2006 12:06:58 -0800
Vladimir Vukicevic wrote:
This sounds impossible to implement with any surface but the image
backend -- cairo has no knowledge of what pixels actually get touched
by underlying platform methods. What are the use cases for this?
Yes, that is why I said it was a *new* surface type. I would expect the
code to start from the code for the Image backend. However it needs to
add the code to do the callback.
Conversely removing the need to think about anything other than one
pixel (or perhaps it does not bother remembering the color at all)
should simplify it a lot, which may be important. In my experience with
hit-detection, you have to draw the image many times, so that you can
start with a larger area and narrow down until a single object is
chosen. I don't believe there is any other reliable method for finding
the nearest object to a click. Drawing multiple times also allows
detection areas that are not rectangles, by intersecting several. In any
case the Image backend is too slow for such gui work, the redraws for
hit detection may slow down GUI feedback far more than the
hardware-accelerated back end. Thus making a very efficient hit detect
surface with no extra overhead for doing anything else is probably a
good idea.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]