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

Bug 320014

Summary: Connection anchor returns wrong position when source is contained within target
Product: [Modeling] GMF-Runtime Reporter: Syed Atif <syedatif>
Component: GeneralAssignee: Syed Atif <syedatif>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aboyko, ahunter.eclipse
Version: 1.4.0Keywords: contributed
Target Milestone: 1.4.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix
none
Fix none

Description Syed Atif CLA 2010-07-15 12:35:45 EDT
Build Identifier: org.eclipse.gmf.runtime.draw2d.ui_1.4.0.v20100514-1615

The BaseSlidableAnchor returns an incorrect anchor location when the source figure is contained within the target figure. For example, if the source figure is in the top left portion of the contained figure, and if the user tries to create a connection from the source figure to the bottom right corner, the connection will be created from the source figure to the top left corner instead.

The reason for this behaviour is that the BaseSlidableAnchor tries to determine the closest point to the target figure, and in doing ends up with a position on the top left corner of the (imaginary) line connecting source figure and user location.

Reproducible: Always
Comment 1 Syed Atif CLA 2010-07-15 12:39:17 EDT
Created attachment 174419 [details]
Fix

If the source anchor location is within the the bounds of the target figure, then we do not use the closest point to the source anchor location.
Comment 2 Syed Atif CLA 2010-07-15 13:07:28 EDT
Created attachment 174422 [details]
Fix

Removed the trace statements
Comment 3 Alex Boyko CLA 2010-07-15 16:24:34 EDT
Delivered to HEAD and R1_4_maintenance