Event woes for items with irregular shapes



Hi,

I'm trying to port an old game from GnomeCanvas to GooCanvas/GTK+ 3.

The main canvas consists of continents with countries, where each
country is a group containing image + ellipse for the capital.
Country groups are connected to the various event signals so that when
the pointer moves across the border to a different country, the
enter-notify-event handler ought to display data about the country
where the pointer is.

Unfortunately, it doesn't happen in practice as countries have
irregular shapes and the new country starts to receive events only
when the pointer moves beyond the imaginary rect of the old country.
(Country images are rects with opaque territory and translucent area
beyond their borders.)  I suppose this is somewhat hard to understand,
so let me try to illustrate:

--------------,
|             |
`      A      | 
|`            |
| `           |
|  `          |
| X `         |
|    `        |
|     `--------
|  B       |
|          |
`-----------

When pointer moves from country A to area X, the desired behavior is
to obtain country B.  But still A is shown because area X, although
territory of country B, is still part of the rect that A occupies.
IOW, when the pointer is in area X, country A continues to receive
events.

This works flawlessly with GnomeCanvas where country groups are
connected to the "event" signal.  I suppose that I made some mistake
but I can't figure it out, so I'd appreciate any kind of help.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]