Drawing speed in rev 2.8
Scott Rossi
scott at tactilemedia.com
Mon Jun 4 13:49:15 EDT 2007
Recently, James Hurley wrote:
> I've just moved over to 2.8 and have found a significant loss of
> speed in drawing with the pencil tool.
>
> Does anyone have any idea why the handler below would take 88 ticks
> in 2.7, but 302 ticks in 2.8?
I see the same speed you describe in 2.8.1. Not sure why there is a
difference compared to older versions, but the following could be a
workaround for you, plus allow you to somewhat control the speed at which
the drawing is completed.
[ between the NEW comments ]
on mouseUp
put the ticks into tStartTime
repeat while the number of images >0
delete image 1
end repeat
put the width of this card/2 into x0
put the height of this card/2 into y0
put 0 into x
put 0 into y
put 2 into tStep
put 0 into tAng
put pi/180 into radPerDeg
choose the pencil tool
-- BEGIN NEW
put "" into tLocked
repeat with tAng = 1 to 360
if tAng mod 8 <> 0 then -- HIGHER NUMBER = FASTER DRAW RATE
if not tLocked then
lock screen
put true into tLocked
end if
else
unlock screen
put false into tLocked
end if
-- END NEW
put tStep* cos(radPerDeg* tAng) into dx
put tStep * sin(radPerDeg * tAng) into dy
drag from round(x0+x),round(y0+y) to round(x0+x+dx), round(y0+y+dy)
add dx to x
add dy to y
end repeat
choose the browse tool
put the ticks - tStartTime into msg box
end mouseUp
Regards,
Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
More information about the use-livecode
mailing list