Re: Event woes for items with irregular shapes
- From: Yavor Doganov <yavor gnu org>
- To: goocanvas-list gnome org
- Subject: Re: Event woes for items with irregular shapes
- Date: Mon, 27 Aug 2018 12:26:11 +0300
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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]