Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349406 - Ellipse optimization w.r.t. to outline shape should also be added to fill shape.
Summary: Ellipse optimization w.r.t. to outline shape should also be added to fill shape.
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-15 03:58 EDT by Alexander Nyßen CLA
Modified: 2011-06-30 18:14 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-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.