I just want to draw the circle which is exactly 15x15 pixels sized, and have fill and outline. I'm using Java2D. The problem is, as a result of sequentally called Graphics2D.fill(circle)
and Graphics2D.draw(circle)
the circle of 16x16 pixels drawn. It is because of internal Java2D outlinig mechanism, which for given 15x15 size provides 16x16 circle outline. Furthermore, if I ask Java2D to draw 14x14 pixels circle outline - it draws exactly 14x14 px. I have tried to play with antialiasing and stroke hints of renderer with no luck.
Here are:
RenderingHints.VALUE_STROKE_NORMALIZE
andEllipse2D.Double(0, 0, 15, 15)
outlineRenderingHints.VALUE_STROKE_PURE
and same outline - notice 1px distortion- previous stroke hint and
Ellipse2D.Double(0, 0, 14, 14)
RenderingHints.VALUE_STROKE_NORMALIZE
,Ellipse2D.Double(0, 0, 15, 15)
outline and antialiasing hint
So, I can't draw 15px circle outline (also 13 px, 29 px and any odd size) with Java2D. Is there a way to draw some sort of inner stroke, which fills pixels at inner border of shape?