|
Re: Location Translation [message #143374 is a reply to message #143314] |
Mon, 19 July 2004 17:23 |
Pratik Shah Messages: 1077 Registered: July 2009 |
Senior Member |
|
|
Does converting both coordinates to absolute (via
Figure#translateToAbsolute()) not work? If you do this, you shouldn't have
to adjust for the zoom scale.
"Larry Waldman" <lfw@andrew.cmu.edu> wrote in message
news:cdglv4$tif$1@eclipse.org...
> I know there must be a way to do this, but as yet, I have been unable to
> find how. Perhaps someone can help:
>
> I have the coordinates of the mouse cursor in the ViewPort, and, in short,
> what I am trying to do is figure out the proximity of the cursor to
> components (any object) in the viewport.
>
> I can adjust the cursor location based on the zoom scale, and then compare
> to the figure's center location -- however, this does not take into
> account the state of the scrollbars.
>
> I'm thinking there MUST be a simple way to either translate objects'
> coordinates to viewport coordinates or vice-versa, and translate the
> cursor's coordinates to absolute coordinates which can be compared with
> figures' coordinates.
>
> Can anyone help?
>
> Thanks!
>
> LFW
>
|
|
|
Re: Location Translation [message #143584 is a reply to message #143374] |
Tue, 20 July 2004 19:36 |
Larry Waldman Messages: 9 Registered: July 2009 |
Junior Member |
|
|
Thanks...that gave me the solution to the problem. I converted all
coordinates to absolute, and then, once my comparison was done, converted
back to relative to the viewport.
I'm just curious, does anyone else believe that this is an extremely long
winded way to do something simple? Seems like there should be a way to
simply do a one way conversion that adjusts for scroll and zoom. Just my
thoughts.
LFW
Pratik Shah wrote:
> Does converting both coordinates to absolute (via
> Figure#translateToAbsolute()) not work? If you do this, you shouldn't have
> to adjust for the zoom scale.
> "Larry Waldman" <lfw@andrew.cmu.edu> wrote in message
> news:cdglv4$tif$1@eclipse.org...
> > I know there must be a way to do this, but as yet, I have been unable to
> > find how. Perhaps someone can help:
> >
> > I have the coordinates of the mouse cursor in the ViewPort, and, in short,
> > what I am trying to do is figure out the proximity of the cursor to
> > components (any object) in the viewport.
> >
> > I can adjust the cursor location based on the zoom scale, and then compare
> > to the figure's center location -- however, this does not take into
> > account the state of the scrollbars.
> >
> > I'm thinking there MUST be a simple way to either translate objects'
> > coordinates to viewport coordinates or vice-versa, and translate the
> > cursor's coordinates to absolute coordinates which can be compared with
> > figures' coordinates.
> >
> > Can anyone help?
> >
> > Thanks!
> >
> > LFW
> >
|
|
|
Powered by
FUDForum. Page generated in 0.03528 seconds