You could use a Form to draw the arc/circle to get nice antialiasing, and then transfer it onto the canvas.
Here is an example:
-----------------------------------------------------------------------------------------------------------------------------
| circle painter canvas |
circle := [ :radius :lineWidth |
| form halfR aaw color center |
aaw := 1.3. color := Color white. halfR := radius / 2.0. center := halfR asPoint. form := Form extent: radius asPoint depth: 32.
0 to: radius - 1 do: [ :y | 0 to: radius - 1 do: [ :x | | l rp | rp := (x @ y) distanceTo: center. l := rp + aaw > halfR ifTrue: [ (halfR - rp min: aaw max: 0.0) / aaw ] ifFalse: [ (rp - halfR + lineWidth min: aaw max: 0.0) / aaw ]. form colorAt: x @ y put: (color alpha: l) ] ]. form ].
painter := [ :form :color | | output bitBlt | output := Form extent: form extent depth: 32. bitBlt := BitBlt toForm: output. output fillColor: color. bitBlt sourceForm: form; combinationRule: 37; sourceRect: form boundingBox; copyBits. output ].
"=====================================" canvas := FormCanvas extent: 200@200. World fullDrawOn: canvas.
canvas translucentImage: (painter value: (circle value: 50 value: 10) value: Color orange) at: 20@20; translucentImage: (painter value: (circle value: 60 value: 15) value: Color purple) at: 90@20; fillRectangle: (40@45 extent: 12@12) color: Color green; fillRectangle: (110@55 extent: 12@12) color: Color blue; fillRectangle: (77@75 extent: 16@21) color: Color brown; translucentImage: (painter value: (circle value: 100 value: 7) value: Color red) at: 30@95 sourceRect: (0@60 extent: 100 @ 40).
canvas form inspect --------------------------------------------------------------------------------------------------------------------
Best regards, Henrik
squeak-dev@lists.squeakfoundation.org