Re: Event woes for items with irregular shapes



On Mon, 2018-08-27 at 12:26 +0300, Yavor Doganov wrote:
Damon Chaplin wrote:
On Mon, 2018-08-27 at 08:20 +0300, Yavor Doganov wrote:
(Country images are rects with opaque territory and translucent
area
beyond their borders.)
One solution may be to create your own custom canvas item, similar
to
GooCanvasImage, but keep the pixbuf around and use that to check
the
pixel, using code similar to GnomeCanvas.

Thank you very much, this works perfectly.  I just changed a bit
goo_canvas_image_is_item_at and added the pixbuf as member of the
image data struct so that I have easy access to it.

The only problem is that I had to duplicate all of goocanvasimage.c
and incorporate that into the program's code, but that's merely
inconvenience.  (I also had to declare
goo_canvas_cairo_pattern_from_pixbuf as it's a private function.)

(I probably should have done that with GooCanvasImage.)

Perhaps it is not too late, in a future release?  The change is
minimal and I think it's worth it, even if it ends up being
ABI-incompatible.  Your call in any case, I just want to thank you
once again for the quick and accurate advice.

Wow. You did that quick! I think you're a better coder than me!

Unfortunately I don't really spend much time on GooCanvas any more, so
the chances of a fix are quite low.

I think the new GTK has broken GooCanvas quite a bit too, so it may not
have too much of a future.

Damon




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