Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » creating bend point - zoom problem
creating bend point - zoom problem [message #1403194] Tue, 22 July 2014 10:01 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 547
Registered: June 2011
Senior Member
If i create a bend point in the connection when the zoom is not 100% then bendpoint end end in a weird position. If zoom is 100% then every thing works fine.

How should i handle zoom when creating bending points?

cheers,
Re: creating bend point - zoom problem [message #1420003 is a reply to message #1403194] Tue, 09 September 2014 11:18 Go to previous message
Maarten Bezemer is currently offline Maarten BezemerFriend
Messages: 117
Registered: February 2012
Senior Member
You have to translate the screen/absolute coordinates (from #getLocation()) to relative coordinates. Assuming you have a BendpointEditPolicy set up, you need something like this to translate the coordinates:

protected Command getCreateBendpointCommand(final BendpointRequest request)
{
    Point p = request.getLocation();
    ConnectionEditPart source = request.getSource();
    source.getFigure().translateToRelative(p);

    return new YourBendPointCreateCommand(source.getModel(), request.getIndex(), p);
}


Cheers,
Maarten
Previous Topic:[ZEST] custom layout class access restriction
Next Topic:Weird Node Resizing Problem
Goto Forum:
  


Current Time: Fri Jul 03 22:08:03 GMT 2015

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

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