Skip to main content



      Home
Home » Eclipse Projects » GEF » Viewport strange behaviour
Viewport strange behaviour [message #45479] Mon, 25 November 2002 13:55 Go to next message
Eclipse UserFriend
Hi

I encountered strange behavoiur of ViewPort, probably it's a bug.
If I extend edit area to the left, translateToAbsolute returns wrong
coordinate.
Suppose that I extended area by 100 pixels, so horizontalRangeModel.value
== -100.
Then I try to get absolute coordinate for relative x == 50 (area is scrolled
to the left).
I expected to get -50, but got 150. Probably there should be no "-" here:

---
public void translateToParent(Translatable t){
if (useTranslate)
t.performTranslate(
-getHorizontalRangeModel().getValue(),
-getVerticalRangeModel().getValue()
);
super.translateToParent(t);
}
---

--
WBR Kir
Re: Viewport strange behaviour [message #45509 is a reply to message #45479] Mon, 25 November 2002 14:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

It is working correctly. If you ask for relative x = 50, and you can see x
= -100, that means the origin (0,0) is shifted to the right 100 pixels. So
50, relative to the origin, is shifted to the right 100 on the Canvas = 150.

"Kirill Paliy" <kpaliy@aaanet.ru> wrote in message
news:artrpo$5hk$1@rogue.oti.com...
> Hi
>
> I encountered strange behavoiur of ViewPort, probably it's a bug.
> If I extend edit area to the left, translateToAbsolute returns wrong
> coordinate.
> Suppose that I extended area by 100 pixels, so horizontalRangeModel.value
> == -100.
> Then I try to get absolute coordinate for relative x == 50 (area is
scrolled
> to the left).
> I expected to get -50, but got 150. Probably there should be no "-" here:
>
> ---
> public void translateToParent(Translatable t){
> if (useTranslate)
> t.performTranslate(
> -getHorizontalRangeModel().getValue(),
> -getVerticalRangeModel().getValue()
> );
> super.translateToParent(t);
> }
> ---
>
> --
> WBR Kir
>
>
Re: Viewport strange behaviour [message #45569 is a reply to message #45509] Mon, 25 November 2002 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Probably I misunderstood meaning of relative coordinate, but I get
50(40,30...) in request.getLocation in getConnectionCompleteCommand when
trying to create link to point with absolute -50(-60,-70..), so I decided
that this coordinate is relative to -100, not to 0. Please correct me if I
wrong.

"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:artsrh$6av$1@rogue.oti.com...
> It is working correctly. If you ask for relative x = 50, and you can see
x
> = -100, that means the origin (0,0) is shifted to the right 100 pixels.
So
> 50, relative to the origin, is shifted to the right 100 on the Canvas =
150.
>
> "Kirill Paliy" <kpaliy@aaanet.ru> wrote in message
> news:artrpo$5hk$1@rogue.oti.com...
> > Hi
> >
> > I encountered strange behavoiur of ViewPort, probably it's a bug.
> > If I extend edit area to the left, translateToAbsolute returns wrong
> > coordinate.
> > Suppose that I extended area by 100 pixels, so
horizontalRangeModel.value
> > == -100.
> > Then I try to get absolute coordinate for relative x == 50 (area is
> scrolled
> > to the left).
> > I expected to get -50, but got 150. Probably there should be no "-"
here:
> >
> > ---
> > public void translateToParent(Translatable t){
> > if (useTranslate)
> > t.performTranslate(
> > -getHorizontalRangeModel().getValue(),
> > -getVerticalRangeModel().getValue()
> > );
> > super.translateToParent(t);
> > }
> > ---
> >
> > --
> > WBR Kir
> >
> >
>
>
Re: Viewport strange behaviour [message #45598 is a reply to message #45569] Mon, 25 November 2002 15:11 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

All information that comes from Tools and Requests is absolute. You must
translateToRelative().

"Kirill Paliy" <kpaliy@aaanet.ru> wrote in message
news:artvlg$7up$1@rogue.oti.com...
>
> Probably I misunderstood meaning of relative coordinate, but I get
> 50(40,30...) in request.getLocation in getConnectionCompleteCommand when
> trying to create link to point with absolute -50(-60,-70..), so I decided
> that this coordinate is relative to -100, not to 0. Please correct me if I
> wrong.
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:artsrh$6av$1@rogue.oti.com...
> > It is working correctly. If you ask for relative x = 50, and you can
see
> x
> > = -100, that means the origin (0,0) is shifted to the right 100 pixels.
> So
> > 50, relative to the origin, is shifted to the right 100 on the Canvas =
> 150.
> >
> > "Kirill Paliy" <kpaliy@aaanet.ru> wrote in message
> > news:artrpo$5hk$1@rogue.oti.com...
> > > Hi
> > >
> > > I encountered strange behavoiur of ViewPort, probably it's a bug.
> > > If I extend edit area to the left, translateToAbsolute returns wrong
> > > coordinate.
> > > Suppose that I extended area by 100 pixels, so
> horizontalRangeModel.value
> > > == -100.
> > > Then I try to get absolute coordinate for relative x == 50 (area is
> > scrolled
> > > to the left).
> > > I expected to get -50, but got 150. Probably there should be no "-"
> here:
> > >
> > > ---
> > > public void translateToParent(Translatable t){
> > > if (useTranslate)
> > > t.performTranslate(
> > > -getHorizontalRangeModel().getValue(),
> > > -getVerticalRangeModel().getValue()
> > > );
> > > super.translateToParent(t);
> > > }
> > > ---
> > >
> > > --
> > > WBR Kir
> > >
> > >
> >
> >
>
>
Previous Topic:Bendpoint selection
Next Topic:having problem with mouselistener...
Goto Forum:
  


Current Time: Mon Apr 28 00:42:36 EDT 2025

Powered by FUDForum. Page generated in 0.02822 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top