I’ve been messing about with this for hours and can’t come up with a solution.
What I want is a nice rounded end - the canvas is 30 pixels high.
This is the code:
g.ForeColor = kGrayMid
You can see the odd artifact in image 1 with the vertical line at the beginning of the shape.
With the code posted above, I’ve drawn a 1px keyline around the object - YES, this does cause the artifact, but if I don’t have that 1px keyline, then I have a different artifact as in image 2, which has a semi-transparent (anti-aliased) outline - and not as sharp as image 1, not good enough either.
That brings us to image 3. This shows a 15px radius. OR is it? The artifact has disappeared but that throws up other questions about rounded corners. In my experience using Adobe Illustrator and Autocad, to get a complete semi-circle rounded end, you simply make the radius of the corners half the height, ie. 15 in my case with a 30px high rectangle - so what is going on here?
So, we finally come to image 4. As a test I changed the code to:
The 50 pixels result is very familiar. The radius is larger than the height of the rectangle and therefore shows XOR as in when bezier curves overlap - I think.
Nevertheless, I’d like sharp rounded corners.