[Pharo-dev] About dashed lines in Athens

milton mamani akevalion at gmail.com
Thu Nov 21 14:03:11 EST 2019


Hi to all

I was playing with Athens and I found and error that you can reproduce with
the next script in Pharo8x64 macOs
```Smalltalk
AthensSurfaceExamples openViewOn: [ :can |
can pathTransform restoreAfter: [
can pathTransform translateX: 30 Y: 30.
can pathTransform rotateByDegrees: 35.
can setPaint: Color red.
can setStrokePaint: Color black.

can setShape: (-20@ -20 corner: 20@ 20).
can draw.
].
].
AthensSurfaceExamples openViewOn: [ :can |
can pathTransform restoreAfter: [
can pathTransform translateX: 30 Y: 30.
can pathTransform rotateByDegrees: 35.
can setPaint: Color red.
(can setStrokePaint: Color black)
width: 6;
dashes: #(4) offset: 0.

can setShape: (-20@ -20 corner: 20@ 20).
can draw.
].
].
AthensSurfaceExamples openViewOn: [ :can |
can pathTransform restoreAfter: [
can pathTransform translateX: 30 Y: 30.
can pathTransform rotateByDegrees: 35.
can setPaint: Color red.
can setStrokePaint: Color black.
can setShape: (-20@ -20 corner: 20@ 20).
can draw.
].
].
```

The previous examples opens 3 windows
The first the line is normal
The second the line is dashed
The third one should be normal, but it is dashed

Why because there is a cache for the color black in the methods
`setStrokePaint:`

I think that we need to fix this,

Cheers,
Milton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20191121/a5cd0d5f/attachment.html>


More information about the Pharo-dev mailing list