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

Bug 349406

Summary: Ellipse optimization w.r.t. to outline shape should also be added to fill shape.
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-15 03:58:54 EDT
Ellipse#outlineShape() performs some optimizations w.r.t. to eliminating line width effects. This optimization is not performed within fillShape, so that the background may get painted larger than the outlin (see attached screenshot).

Ellipse#fillShape() should contain the same optimizations:

protected void fillShape(Graphics graphics) {
		float lineInset = Math.max(1.0f, getLineWidthFloat()) / 2.0f;
		int inset1 = (int) Math.floor(lineInset);
		int inset2 = (int) Math.ceil(lineInset);

		Rectangle r = Rectangle.SINGLETON.setBounds(getBounds());
		r.x += inset1;
		r.y += inset1;
		r.width -= inset1 + inset2;
		r.height -= inset1 + inset2;

		graphics.fillOval(r);
}
Comment 1 Alexander Nyßen CLA 2011-06-30 18:14:39 EDT
Fixed. Committed changes to cvs HEAD as well as R_3_7_maintenance branch.