Re: [goocanvas] Transform item group to new canvas coordinate space



On Wed, 2018-03-07 at 18:44 +0100, Felix Weilbach t-online de wrote:

Hello,

 

I have GooCanvas with a GooCanvasImage in it. On this GooCanvasImage are multiple GooCanvasPathes.

Now when the user scales the canvas, the GdkPixbuf of the GooCanvasImage gets updated (bigger/smaller) and as a result the bounds of the GooCanvas gets updated too (with goo_canvas_set_bounds).

 

The problem with that is that the GooCanvasPathes looses their relative position to the content of the GooCanvasImage.

I have the GooCanvasPathes grouped in a GooCanvasGroup.

I think it should be a easy task to achive that the GooCanvasPathes (that are grouped in a GooCanvasGroup) update also their position (bounds) so that they stay in the right relative position to the GooCanvasImage content.

Unfortunately I could not find a function that updates the bounds of the GooCanvasGroup or maybe there is better way to achive what I want.


I think you can use the GooCanvasItem functions like this to move the group:

goo_canvas_item_translate (group, x, y);

or scale it like this:

goo_canvas_item_scale (group, scale_x, scale_y);

Damon



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