Crawling Ants...Should be Staggering Ants!

Sean Charles bibbers at onetel.net.uk
Tue May 13 14:54:36 UTC 2003


I'm playing with PolygonMorph (what a tool!) with a view to using it as a 
flight-path specifier for an animation package I started over four year 
ago, must be bored again. The joys of unemployment...anyway, when I set a 
dashed line and stepping rate, the ants don't march, they stagger.

There is a visible meandering of the line of plus/minus a pixel or two. I'
ve studied the code but my brain has given up on me. My gut feeling is 
that *something* is being *unnecessarily* recalculated every step, 
otherwise the line would remain perfectly stationary and only the color 
segments would appear to move along the line.

The difference is (I think) inside either,

PolygonMorph>>drawDashedBorderOn: aCanvas usingEnds: anArray
OR
Canvas>>line: pt1 to: pt2 width: width color: color1 dashLength: s1 
secondColor: color2 secondDashLength: s2 startingOffset: startingOffset

I THINK! (Well, I think I think, at least I think I do sometimes...)

Would anybody with a deeper insight into the gizzards of either 
PolygonMorph or Canvas or Squeak or all of the above care to pass comment.

I am thinking that a wicked optimization (at the expense of memory as 
usual) is in the offing such that unless the 'vertices' array is given 
cause to change i.e. user tweaks the morph, adds or removes a point etc 
etc then the current vertices array could be cached etc. This is where I'm 
confused. I watched 'vertices' and it doesn't change!!! So it must be some 
kind of 'crawling' error in the line drawing itself. HELP ME! My brain 
hurts and Night Nurse don't work no more.

Sean Charles.



More information about the Squeak-dev mailing list