The effect draw block is growing each time you
add a new line or circle to draw.
Each time

        show b

is called, everything in the draw block is drawn.
So as it grows, so it slows.

A solution is to capture b's image once every while
or perhaps every iteration, with:

        img: to-image b

and clear the draw block at the same time.
Then set b's image like this:

        b/image: img

and at the next iteration, draw on top of that.

Anton.

> Hi all !!
>
> i'm new in rebol and i'm not good in english so i'd try to be clear.
>
> I just test a script from auverlot's book, here it is :
>
> **********
> REBOL []
> pos-xy: none
> view layout [
>    b: box 400x400 white feel [
>       detect: func [face event] [
>          switch event/type [
>             move [
>                pos-xy: event/offset
>                append b/effect/draw reduce [pos-xy]
>                show b
>             ]
>             down [
>                pos-xy: event/offset
>                append b/effect/draw reduce ['circle pos-xy 30 'line]
>                show b
>             ]
>             alt-down [
>                append b/effect/draw reduce ['fill-pen (random 255.255.255)
> 'line]
>             ]
>          ]
>       ]
>       redraw: none
>    ] effect [draw ['pen black 'line]]
> ]
> ************
>
> So first when i moved around the mouse over the box very fast the
> pen seems
> to follow very good.
> but if i click down just one time (a circle is paint in the box), then
> suddenly the pen seems to
> be late. if i stop move the mouse, the pen ends up arriving, and if i move
> fast again, the pen is
> always late.
>
> I don't understand why a simple draw circle command in a dynamic drawing
> decrease the drawing performance.
>
> I hope that you've understand my question. Thanks in advance to all.
>
> Fred.

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to