### 5.102 Stroke

• Stroke( <element1>, ..., <elementN> ).
• Description: that function recalculate the graphical elements : <element1>, ..., <elementN>, then redraw them using NORMAL mode and returns Nil.
• Exemple(s): we created two global variables: $a$ and drawing. We will create the circle with center a and radius 1 called object1, we want to be able to move it with the mouse. To do that, we create the macro ClicG with the command:
[PenMode:=1, {NotXor mode}
NewGraph("object1", "Cercle(a,1)"),
PenMode:=0, {normal mode}
ReDraw(), {we show}
drawing:=1]

we create the macro MouseMove with the command: if drawing then a:=%1 {we move the center}, Move(object1) fi,

then the macro LButtonUp with the command: if drawing then Stroke(object1), drawing:=0 fi.

The macro ClicG creates the object1 in NotXor mode, update the graphical display and switch to the "drawing" mode. The macro MouseMove places the center a at the mouse place, then moves the object1. When the left button is released, we draw the object1 in normal mode and quit the "drawing" mode.