How can I reverse the direction of the Y axis? [message #208925] |
Thu, 09 February 2006 20:59 |
Eclipse User |
|
|
|
Originally posted by: geoff_crowther.uk.ibm.com
BlankIn the GEF examples (e.g. Logic) the origin (0, 0) is at the top right
of the editor window. Positive Y values are below this origin, and negative
Y values are above. Is there any way to change this direction, so that
positive Y is upwards, preferably also changing the default location of the
origin to be the bottom left of the editor window? This would allow the
editor to match the conventional representation of an X,Y coordinate system.
Many thanks for your help.
Geoff Crowther
|
|
|
|
|
Re: How can I reverse the direction of the Y axis? [message #209045 is a reply to message #208925] |
Fri, 10 February 2006 15:48 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Rectangle rect = canvas.getClientArea();
Transform t = new Transform(Display.getCurrent());
t.translate(0f, (float)(rect.height - rect.y));
t.scale( 0f, -1f);
gc.setTransform(t);
"geoffc" <geoff_crowther@uk.ibm.com> wrote in message
news:dsga83$pko$1@utils.eclipse.org...
> BlankIn the GEF examples (e.g. Logic) the origin (0, 0) is at the top
> right
> of the editor window. Positive Y values are below this origin, and
> negative
> Y values are above. Is there any way to change this direction, so that
> positive Y is upwards, preferably also changing the default location of
> the
> origin to be the bottom left of the editor window? This would allow the
> editor to match the conventional representation of an X,Y coordinate
> system.
>
> Many thanks for your help.
>
> Geoff Crowther
|
|
|
Re: How can I reverse the direction of the Y axis? [message #210329 is a reply to message #209045] |
Sat, 25 February 2006 09:50 |
Eclipse User |
|
|
|
Originally posted by: geoff_crowther.uk.ibm.com
Randy
Many thanks for your suggestion. Unfortunately I am new to GEF, and cannot
see where to hook this in to my application which is currently loosly based
on the "Logic" example application. Could you provide a few pointers for
me.
Thanks again
Geoff
"Randy Hudson" <none@us.ibm.com> wrote in message
news:dsicl5$5ei$1@utils.eclipse.org...
> Rectangle rect = canvas.getClientArea();
> Transform t = new Transform(Display.getCurrent());
> t.translate(0f, (float)(rect.height - rect.y));
> t.scale( 0f, -1f);
> gc.setTransform(t);
>
> "geoffc" <geoff_crowther@uk.ibm.com> wrote in message
> news:dsga83$pko$1@utils.eclipse.org...
> > BlankIn the GEF examples (e.g. Logic) the origin (0, 0) is at the top
> > right
> > of the editor window. Positive Y values are below this origin, and
> > negative
> > Y values are above. Is there any way to change this direction, so that
> > positive Y is upwards, preferably also changing the default location of
> > the
> > origin to be the bottom left of the editor window? This would allow the
> > editor to match the conventional representation of an X,Y coordinate
> > system.
> >
> > Many thanks for your help.
> >
> > Geoff Crowther
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.20969 seconds