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

Bug 349381

Summary: Straight#containsWithinSegment(Vector, Vector, Vector) does not compute parameter s correctly.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF-Legacy Draw2dAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7   
Target Milestone: 3.7.1 (Indigo SR1)   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2011-06-14 18:14:52 EDT
The computation of the parameter s should be:

double s = segmentDirection.isVertical() ? (vector.y - segmentStart.y) / segmentDirection.y
					: (vector.x - segmentStart.x) / segmentDirection.x;

instead of:

double s = segmentDirection.isVertical() ? (vector.y - segmentDirection.y)
					/ segmentDirection.y
					: (vector.x - segmentStart.x) / segmentDirection.x;
Comment 1 Alexander Nyßen CLA 2011-06-30 18:09:17 EDT
Fixed. Changes committed to cvs HEAD as well as R_3_7_maintenance branch.