Skip to main content



      Home
Home » Eclipse Projects » GEF » creating bend point - zoom problem
creating bend point - zoom problem [message #1403194] Tue, 22 July 2014 06:01 Go to next message
Eclipse UserFriend
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 07:18 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 15:57:35 EDT 2025

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

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

Back to the top