Re: Question on GnomeCanvasImage



> Now, here are some code snippets on how I've implemented drawing the board
> and updating it every time someone presses a button on the board.
> 
> board_image is a GdkImlibImage created by loading a PNG file. The PNG file
> has transparancy in it. From fiddling around I noticed that board emits
> an event signal only if I move my mouse over the non-transparent part of my
> image - which is good. However, two problems:
> 
> 	(a) After update_board is called and the image is rotated by 30
>             degrees successfully, it seems that the "area" over which my
>             mouse movement generates an event signal is no longer "the
>             non-transparent part of the image".
>         (b) After update_board is called 2 times, board doesn't generate
>             an event signal anymore.
> 
> Have I done something wrong?
> 
> (oh BTW, I'm using the AA mode of GnomeCanvas because the other mode
> does'nt display rotations correctly - is that a bug or not?).

Hmm, I just figured something out. When I use the non-aa mode of GnomeCanvas
(by calling gnome_canvas_new()), applying a rotation to the canvas item
results in NOT a rotated canvas item, but rather the canvas item being scaled
down and translated to one side. This is why I used aa mode (by calling
gnome_canvas_new_aa()) instead. BUT, even though the canvas item gets
rotated properly, the "area" over which my mouse can cause the canvas item
to emit an event signal got transformed the same way it did in non-aa mode.
(ie. the event area got scaled down and translated). And what happens is
that after a couple of said transformations, the area gets translated
completely out of the scrollable region of the canvas - hence it no longer
generates any event signals.

Is this a bug? Or is my implementation wrong?

Thanx in advance.


|      LOBAN AMAAN RAHMAN  <-- anagram of -->   AHA! AN ABNORMAL MAN!      |
|   Snail: MSC #763, Caltech, Pasadena, CA 91126, USA. ** 1-626-395-1407   |
|     Wired: loban@earthling.net, loban@caltech.edu, http://i.am/loban     |
|        (Do 'finger loban@its' for my PGP public key and more info)       |



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