Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369357

Summary: [jface] Zooming does not work when custom anchors used.
Product: [Tools] GEF Reporter: Erdal Karaca <erdal.karaca.de>
Component: GEF-Legacy ZestAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: steeg
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Example showing zooming not working properly when custom anchors used. none

Description Erdal Karaca CLA 2012-01-23 03:08:36 EST
If I set a custom anchor in selfStyleConnection, then, zooming does not work properly.
It seems that scaling is not applied to the coords the anchor is set to after zooming (in/out).

I will append an example to reproduce this.
Comment 1 Erdal Karaca CLA 2012-01-23 03:11:01 EST
Created attachment 209892 [details]
Example showing zooming not working properly when custom anchors used.
Comment 2 Fabian Steeg CLA 2012-01-26 16:48:07 EST
I had a look at what ChopboxAnchor, an existing subclass of AbstractConnectionAnchor does and it seems you need to translate the rectangle in your implementation of getLocation(). With this in getLocation(), your example zooms fine for me:

Rectangle bounds = Rectangle.SINGLETON;
bounds.setBounds(getOwner().getBounds());
getOwner().translateToAbsolute(bounds);