Skip to main content



      Home
Home » Eclipse Projects » GEF » BendpointEditPolicy - incorrect location after zooming
BendpointEditPolicy - incorrect location after zooming [message #222282] Tue, 29 August 2006 09:05 Go to next message
Eclipse UserFriend
Hello,

I am currently developing a view using GEF. My problem is the following:
after zooming in
or zooming out I try to create/move a bendpoint of a connection. However
the location of
the (new) bendoint location is incorrect if I have zoomed in or zoomed
out. (zoom level 0.5: the bendpoint gets moved half the way it
should be).

Thanks in advance for your help,

Martin
Re: BendpointEditPolicy - incorrect location after zooming [message #1012078 is a reply to message #222282] Wed, 20 February 2013 15:47 Go to previous messageGo to next message
Eclipse UserFriend
Hey,

sorry for digging up this thread.

But I have the exact same problem and cannot figure out how to solve it.

When I zoomed, an want to create/move a bendpoint, the getLocation() method of the request returns a wrong location.

It even returns negative values.

I'd appreciate any help.

Thanks in advance,
Tim
Re: BendpointEditPolicy - incorrect location after zooming [message #1012374 is a reply to message #1012078] Thu, 21 February 2013 07:43 Go to previous messageGo to next message
Eclipse UserFriend
Although I've never create bendpoints, this is definitively a problem related to relative/absolute coordinate system. Check out the javadoc.
Try to translate the location to relative using figure.translateToRelative(location) or something.
Re: BendpointEditPolicy - incorrect location after zooming [message #1012382 is a reply to message #1012374] Thu, 21 February 2013 08:08 Go to previous messageGo to next message
Eclipse UserFriend
I tried to use figure.translateToRelative(location), unfortunately it did not change anything.

At the moment I implemented relative bendpoints according to the Logic example,
which seems to work fine.

I also filed a bug, about the incorrect location https://bugs.eclipse.org/bugs/show_bug.cgi?id=401367 ...

Perhaps I just don't understand the translateTo{Relative, Absolute} methods,
I can't really find a good explanation...

[Updated on: Thu, 21 February 2013 08:08] by Moderator

Re: BendpointEditPolicy - incorrect location after zooming [message #1012447 is a reply to message #1012382] Thu, 21 February 2013 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Looking at the Bendpoint interface, there is written "A bendpoint returns a point relative to the connection figure on which it is being used."

The getLocation() method of the BendpointRequest returns always absolute coordinates. Absolute means relative to the canvas.
So Calling connection.translateToRelative(location) should change the location according to the actual zoom, scroll or whatever.

Coordinate transformation is dark space for me too. take a look at this http://www.eclipsezone.com/eclipse/forums/t46584.html

By the way, I don't think the bug you filed is actually a bug. The returned location is just in absolute coordinates.

[Updated on: Thu, 21 February 2013 10:20] by Moderator

Re: BendpointEditPolicy - incorrect location after zooming [message #1012450 is a reply to message #1012447] Thu, 21 February 2013 10:24 Go to previous message
Eclipse UserFriend
Thanks for the help...

I'll have a look at it.

I just checked it again, and translateToRelative does change the values.
Probably I forgot something, or did something wrong.

I changed everything to relative bendpoints, which just works fine,
so I'll probably stick to this solution.

Thanks anyway!

And you are probably right about the bug...

[Updated on: Thu, 21 February 2013 10:24] by Moderator

Previous Topic:Best practice for "invisible" figures with an EditPart?
Next Topic:customize gridlayout
Goto Forum:
  


Current Time: Tue Jul 22 18:58:13 EDT 2025

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

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

Back to the top