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

Bug 327891

Summary: Feedback for creating connections incorrect when zoom is not 100%
Product: [Tools] GEF Reporter: Marcel Romijn <mromijn>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Modified ShapesEditor.java to demonstrate problem.
none
Modified ShapesEditorActionBarContributor.java to demonstrate problem.
none
Image showing correct routing with 100% zoom.
none
Image showing incorrect routing with 75% zoom.
none
Patch comprising changes to ShapesEditor and ShapesEditorActionBarContributor as well as a fix for ShapesEditPart none

Description Marcel Romijn CLA 2010-10-15 09:43:46 EDT
Build Identifier: 3.5.2

We are using the ShortestPathConnectionRouter in our GEF based editor to route connections around obstacles. When the zoom-level is 100%, everything works correct.

The problem arises when the zoom-level is not 100%, but e.g. 75%.
- All figures are drawn at 75% and existing connections are correctly routed around the figures.
- While a new connection is created, the line drawn while dragging is routed around the figures as if they were 100%.
- When the connection is created (i.e. stop dragging) the new connection is routed correctly around the figures.

So the problem only occurs during dragging.


Reproducible: Always

Steps to Reproduce:
1. Add the zoom functionality to the shapes example (I copied most code over from the logic example)
2. Run the shapes example and set the zoom factor to 75%
3. Create a new connection and while dragging, watch that it bend on locations where the shapes would be at 100%
Comment 1 Alexander Nyßen CLA 2011-01-15 10:41:32 EST
Well, "Add the zoom functionality to the shapes example" is quite an ambiguous step to reproduce... Could you please attach a patch that contains your modifications to the shapes example so we can rule out that ambiguity?

The Logic example also provides a means to use the ShortestPathConnectionRouter (you can specify a property when selecting the canvas). I tried it out there and could not observe any faulty behavior when zooming. Could you please confirm or decline whether your issue is reproducible there?
Comment 2 Marcel Romijn CLA 2011-01-17 10:23:21 EST
Created attachment 186907 [details]
Modified ShapesEditor.java to demonstrate problem.
Comment 3 Marcel Romijn CLA 2011-01-17 10:24:03 EST
Created attachment 186908 [details]
Modified ShapesEditorActionBarContributor.java to demonstrate problem.
Comment 4 Marcel Romijn CLA 2011-01-17 10:24:45 EST
Created attachment 186909 [details]
Image showing correct routing with 100% zoom.
Comment 5 Marcel Romijn CLA 2011-01-17 10:25:11 EST
Created attachment 186910 [details]
Image showing incorrect routing with 75% zoom.
Comment 6 Marcel Romijn CLA 2011-01-17 10:25:30 EST
Thanks for looking into this.

Sorry for the ambiguous step.

I just redid my steps with Eclipse 3.6.1 and GEF 3.6.1.
I attached a modified version of "ShapesEditor.java" and "ShapesEditorActionBarContributor.java". These add the zoom control in the toolbar of the shapes example.
The problem still occurs with this version of GEF. See the attached images for 75% zoom ("75 percent.png") and 100% zoom ("100 percent.png").

I also tried to do the same with the Logic example with the Connection Router set to Shortest Path, but indeed the problem does not occur there.
Comment 7 Alexander Nyßen CLA 2011-01-17 13:39:34 EST
Coud you please create a patch for the Shapes project (right-click on the project, then Team->Create Patch) and add it as an attachment? That would make it easier for me to review the changes you have made?
Comment 8 Alexander Nyßen CLA 2011-01-17 14:01:57 EST
Marcel, I figured out that you ran into a similar problem than the one being described in bug #66590 for the logic example. In order to have the feedback drawn correctly, you will have to ensure that the GraphicalNodeEditPolicy adds it to the scaled feedback layer.
Comment 9 Alexander Nyßen CLA 2011-01-17 14:03:36 EST
Created attachment 186939 [details]
Patch comprising changes to ShapesEditor and ShapesEditorActionBarContributor as well as a fix for ShapesEditPart

I attached a patch that comprises the changes to ShapesEditor and ShapesEditorActionBarContributor, and additionally demonstrates the fix for the GraphicalNodeEditPolicy.
Comment 10 Marcel Romijn CLA 2011-01-18 15:24:07 EST
Hi Alexander,

I installed the GEF examples instead of pulling them from CVS. That's why I didn't make a patch. But lesson learned...!

I provided the same fix to the subclass of GraphicalNodeEditPolicy in our product and indeed, the feedback is now correct with scalings other than 100%.

Thanks for locating the problem. Glad it is a problem of our implementation and not a problem in GEF :-)
Comment 11 Alexander Nyßen CLA 2011-01-18 15:29:28 EST
Fine. Resolving this as invalid then.