Le 2/4/16 17:31, Aliaksei Syrel a ��crit��:

You don't want to draw a shape, you configure it. Shape can not be drawn, it is not an AthensPath.

cell shape: (BlShape new
�� path: BlCirclePath new;
�� strokePaint: (BlStrokePaint new
�������� paint: Color blue;
�������� width: 1)).
cell extent: 50@50.


But this is not what I want! As I mentioned in a mail that was sent but never arrived.
I want a square and this is why I did

BlCell>>initialize
������ super initialize.
������ self
������ ������ shape:
������ ������ ������ (BlShape new
������ ������ ������ ������ fillPaint: (BlColorPaint new color: (Color yellow));
������ ������ ������ ������ path: BlRectanglePath new);
������ ������ extent: self extent


then I want to draw something extra this is why I overrode drawOnAthensCanvas: aCanvas

Now I stop but I find bloc too complex.

Sorry but I cannot lose time like that and just get frustrated at the end.
I will use the athens canvas directly and stay in morph for now.

Stef

On Apr 2, 2016 4:57 PM, "stepharo" <stepharo@free.fr> wrote:
Hi

I want a square morph with a circle or a line at 45 degree inside
Now I do not get it.

I thought that I needed to specialize drawOnAthensCanvas: so I did

BlCell >> drawOnAthensCanvas: aCanvas

�� �� super drawOnAthensCanvas: aCanvas.
�� �� aCanvas
�� �� �� �� drawShape: (BlShape new
�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� strokePaint:
�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��(BlStrokePaint new
�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� paint: (BlColorPaint new color: (Color blue));
�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� width: 15);
�� �� �� �� �� �� �� �� �� �� �� �� �� �� path: BlCirclePath new).

Now I do not know how I can specify a shape size

So I will use another API than drawShape:

Stef