Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Coordinates, zoom and scrollbars
Coordinates, zoom and scrollbars [message #148264] Fri, 20 August 2004 13:39 Go to next message
Roberto is currently offline RobertoFriend
Messages: 42
Registered: July 2009
Member
Hi all,
I need to draw a line as insertion point for the part to be newly created.
The position depends on the cursor location and the underlying parts.
If I do not translate the line points to absolute the line position and
size will be OK if zoom is 100% but shrinked if the zoom differs from 100%.
If I translate the line points to absolute the line will be OK for all zoom
value but will wrong if the editor's scrollbar are not in the top-left
position.
I can't have my line with the right position and size for both zoom
different from 100% AND scrollbars not on top-left position.

To draw the line I first translate the points and the create a Polyline

What am I doing wrong?
I am using Eclipse 3.0 with GEF 3.0 on Win 2000

Thanks in advance for any help

Roberto
Re: Coordinates, zoom and scrollbars [message #148267 is a reply to message #148264] Fri, 20 August 2004 14:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The feedback layer is not scaled, but it is translated during scrolling. To
correct for this, once you are in absolute coordinates, you need to call:

myFeedbackLine.translateToRelative(Translatable)
or equivalently:
feedbacklayer.translateToRelative(t)
feedbacklayer.translateFromParent(t)

"Roberto Genini" <roberto.genini@icimsi.ch> wrote in message
news:opsc09j1fk71gv6x@news.eclipse.org...
> Hi all,
> I need to draw a line as insertion point for the part to be newly created.
> The position depends on the cursor location and the underlying parts.
> If I do not translate the line points to absolute the line position and
> size will be OK if zoom is 100% but shrinked if the zoom differs from
100%.
> If I translate the line points to absolute the line will be OK for all
zoom
> value but will wrong if the editor's scrollbar are not in the top-left
> position.
> I can't have my line with the right position and size for both zoom
> different from 100% AND scrollbars not on top-left position.
>
> To draw the line I first translate the points and the create a Polyline
>
> What am I doing wrong?
> I am using Eclipse 3.0 with GEF 3.0 on Win 2000
>
> Thanks in advance for any help
>
> Roberto
Re: Coordinates, zoom and scrollbars [message #148273 is a reply to message #148267] Fri, 20 August 2004 15:23 Go to previous message
Roberto is currently offline RobertoFriend
Messages: 42
Registered: July 2009
Member
Yes!
It works.

Many thanks

Roberto
Previous Topic:Which tool should I use for drawing lines
Next Topic:MultiLineLabel parent Composite from Draw2D Panel?
Goto Forum:
  


Current Time: Fri Apr 19 14:12:34 GMT 2024

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

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

Back to the top