Re: GnomeCanvas and inverting Y cooordinates



I think applying the transformation to the root group sounds correct.  You
get the root canvas item group with gnome_canvas_get_root().  Now
GnomeCanvasItemGroup's are GnomeCanvasItem's, so you can use
gnome_canvas_item_affine_relative().  You would use something like:

  GnomeCanvasGroup *root = gnome_canvas_root(GNOME_CANVAS(canvas));
  double flip[6] = { 1, 0, 0, -1, 0, 0 };

  gnome_canvas_item_affine_relative(GNOME_CANVAS_ITEM(root), flip);

Now use gnome_canvas_set_scroll_region() to set the area to draw (using
the untransformed coordinate system).

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Thu, 4 Nov 1999 kschumacher@uswest.net wrote:

> Is there a simple way to invert the behavior of
> Y coordinates in GnomeCanvas.
> 
> In postscript I would use a transform matrix something
> like [1 0 0 -1 0 -height] (might be wrong - I haven't
> written postscript this decade).  Is this what an
> affine is?  If I apply that affine to the root group
> will that do what I want?  (And of course, how do I
> apply an affine to a root group, it that's the thing
> to do).  Grin?
> 
> Thanks,
> Kent
> 
> (My seven year old son, just told me my signature should say
> Go Putz!  Is he referring to me?)
> 
> 
> -- 
>         FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
>          To unsubscribe: mail gnome-list-request@gnome.org with 
>                        "unsubscribe" as the Subject.
> 



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