Re: [cairo] Hit detect surface?
- From: David Trallero Mena <ditiem gmail com>
- To: Bill Spitzak <spitzak d2 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 11:27:38 +0100
Bill Spitzak escribió:
This talk about GnomeCanvas needing complicated hit detection made me
wonder if Cairo could support hit detection. This could be done with an
entire new surface type and thus not affect any existing cairo backends.
As I see it it would work something like this:
I also have needed to do that. In fact I think complicating cairo is
unnecessary. I just create another surface of 32 bits-per-color and
render everything again there. This new surface I use I refer to as
select surface (hit-surface for you). The color used when re-rendering
is indeed and ID (I have to talk with cairo guys about this) of the
figure (rectangle, ellipse, circle...) that was rendered on the
"original-surface".
Taking external events like mouse or joystick-motion or whatever I just
have to read in the "hit-surface" and see the ID to know which element
was drawn on that point. In my case the ID means the widgets drawn
there, in yours, it can means the structure that contains the figure
with the operators and colors used,
This is similar to a method used in OpenGL.
Cheers,
David
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]