Skip to main content

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: 550
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?

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();

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

Previous Topic:Moving bend points with source and target
Next Topic:[ZEST] Program Speed
Goto Forum:

Current Time: Sun May 20 12:17:55 GMT 2018

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

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

Back to the top