Bug 369357 - [jface] Zooming does not work when custom anchors used.
Summary: [jface] Zooming does not work when custom anchors used.
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-23 03:08 EST by Erdal Karaca CLA
Modified: 2012-01-26 16:48 EST (History)
1 user (show)

See Also:


Attachments
Example showing zooming not working properly when custom anchors used. (6.15 KB, text/plain)
2012-01-23 03:11 EST, Erdal Karaca CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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);