Thank you Stef,
the example helped me a lot to understand how to play with Athens.
The solution is not what I am looking for. If someone starts to play with alpha canal, s/he will get unexpected results.
I have finally found an example in C language. It look like this:
-=-=-=-=-
cairo_set_line_width (cr, 0.1);
cairo_save (cr);
cairo_scale (cr, 1, 0.2);
cairo_arc (cr, 1.5, 1.5, 1, 0, 2 * M_PI);
cairo_restore (cr);
cairo_set_source_rgba (cr, 0, 1, 0, 0.50);
cairo_stroke (cr);
-=-=-=-=-

I do not know how to write the same instructions with Athens. First, they draw one arc (cairo_arc (cr, 1.5, 1.5, 1, 0, 2 * M_PI);), I draw 4 arcs:
-=-=-=-=-
canvas
createPath: [ :builder |
builder
absolute;
moveTo: 0 @ 0.5;
ccwArcTo: 0.5 @ 0.0 angle: 90 degreesToRadians;
ccwArcTo: 0.0 @ -0.5 angle: 90 degreesToRadians;
ccwArcTo: -0.5 @ 0.0 angle: 90 degreesToRadians;
ccwArcTo: 0 @ 0.5 angle: 90 degreesToRadians ].
-=-=-=-=-
Second, they set line width, before any other action (like cairo_save). I do:
-=-=-=-=-
canvas pathTransform scaleBy: 200 @ 50.
(can setStrokePaint: Color red) width: 0.1.
can drawShape: path.
-=-=-=-=-
So, my result in Athens is like this:
Any idea? The example is explained
here, C source code is
here (by clicking on the image in the
page).
Thank you,
Jura
AthensSceneView new
scene: [ :can |
| path |
path := can
createPath: [ :builder |
builder
absolute;
moveTo: 0 @ 0.5;
ccwArcTo: 0.5 @ 0.0 angle: 90 degreesToRadians;
ccwArcTo: 0.0 @ -0.5 angle: 90 degreesToRadians;
ccwArcTo: -0.5 @ 0.0 angle: 90 degreesToRadians;
ccwArcTo: 0 @ 0.5 angle: 90 degreesToRadians ].
can pathTransform
restoreAfter: [
can pathTransform scaleBy: 200 .
can
setPaint: Color red ;
drawShape: path.
"(athensCanvas setStrokePaint: strokePaint)
width: (self strokeWidth / self scale) asFloat."
can drawShape: path.].
can pathTransform
restoreAfter: [
can pathTransform scaleBy: 190 .
can
setPaint: Color blue ;
drawShape: path.
"(athensCanvas setStrokePaint: strokePaint)
width: (self strokeWidth / self scale) asFloat."
can drawShape: path
]
] ;
openInWindow
<Screen Shot 2014-04-12 at 09.01.09.pdf>