Re: Image Animation feature gone awry



On Tue, 2010-07-27 at 03:02 +0200, Marc Ford wrote:
> I am having an interesting issue with the Animation feature  
> goo_canvas_item_animate from GooCanvasItem
> 
> I set the start position x coordinate and use the same as the end coordinate. I only change the y- coordinate
> 
> 
> making the animated image fall from the top of the canvas down to the bottom. As least that is the idea.
> However the images seem so "spread apart" as they are falling. I have several images on my canvas that are spaced apart.
> 
> 
> The first image always behaves correctly and moves down the canvas in a strait line, however the other images drift off the the
> right in an exponential manner.
> 
> I have the snippet of perl-GooCanvas code as shown below:
> 
> 
> 
> print ("Image Starts at x: $start_pos_x\n");
> my $canvas_image = Goo::Canvas::Image->new(
>            $root,$pixbuf, $start_pos_x, -($image_size_xy));
>     
> $canvas_image->animate($start_pos_x, $canvas_size_y +
> 
> 
> $image_size_xy , 1, 0, TRUE, 5000, 100,'GOO_CANVAS_ANIMATE_FREEZE');
> 
> print ("Ends At x: $start_pos_x\n");
> 
> the console result is: 
> Image Animation Starts at x: 200
> Image Animation Ends at x: 200
> 
> 
> 
> Not trusting that output I let the animation finish and did: $current_x = $canvas_image->get('x');
> Console ouput is: Final X Coordinate using goo_canvas_image get x is: 200
> 
> Something is very wrong, it is almost as if the canvas gets wider at
> 
> 
> the bottom and the coordinate 200 at the top is not the same as 200 on
> the bottom.
> 
> I have a link to a screenshot of the result:
> 1st is at beginning of animation: http://imgur.com/ac1uU.jpg
> 
> 
> 2nd is at end of animation: http://imgur.com/ac1uU&ZDuqkl
> 
> As one can see the images have traveled apart and the screen-shot shows the jitter that the images make towards the right.
> 
> 
> Any help on this would be greatly appreciated.Is this a bug in the perl version of GooCanvas? Im not expert enough to know.

I doubt it is a bug in the perl bindings, as it is a fairly simple
function call.

You could try setting the 'absolute' flag to FALSE, and using a relative
animation - the GooCanvas code that does that is simpler so may not
suffer from this problem. e.g. just use a y_offset:
  $canvas_image->animate(0, $y_offset, 1, 0, FALSE, 
                         5000, 100, 'GOO_CANVAS_ANIMATE_FREEZE');

I guess each of your pictures is a separate canvas item, right?
How are they positioned on the canvas - with "x" & "y" coordinates or
with a translation? Are they scaled at all?

Damon




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