Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349381 - Straight#containsWithinSegment(Vector, Vector, Vector) does not compute parameter s correctly.
Summary: Straight#containsWithinSegment(Vector, Vector, Vector) does not compute param...
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7.1 (Indigo SR1)   Edit
Assignee: Alexander Nyßen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-14 18:14 EDT by Alexander Nyßen CLA
Modified: 2011-06-30 18:09 EDT (History)
0 users

See Also:


Attachments

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