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

Bug 488093

Summary: ellipse contains function
Product: [Tools] GEF Reporter: Sylvain Bi <sylvain.bilange>
Component: GEF GeometryAssignee: gef-inbox <gef-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Sylvain Bi CLA 2016-02-19 05:56:14 EST
Ellipse ellipse = new Ellipse(0, 0, 1, 1);
		Point p = new Point(0, 0);
		System.out.println("1 " + ellipse.contains(p));
		p = new Point(0.5, 0.5);
		System.out.println("2 " + ellipse.contains(p));
		p = new Point(0, 1);
		System.out.println("3 " + ellipse.contains(p));

Output :

1 false
2 true
3 false
Comment 1 Matthias Wienand CLA 2016-02-22 13:51:52 EST
The behavior seems to be fine to me. The ellipse is defined by the enclosing rectangle with top left corner (0, 0) and bottom right corner (1, 1). Therefore, only the center of each segment of that rectangle is contained within the ellipse. Resolving as "works for me", however, feel free to reopen this ticket in case I overlooked the actual issue.