Crawling Ants...Should be Staggering Ants!

Sean Charles bibbers at onetel.net.uk
Tue May 13 18:40:43 UTC 2003


On Tuesday, May 13, 2003, at 05:29 PM, Ned Konz wrote:
> I think this is due to a rounding issue in the dashed line algorithm.
> Does this happen with a perfectly horizontal or vertical line?
>
No, with an L shape it's as expected, the ants crawl and nothing else 
appears to move.


> If you look at the same line without the dashes, you'll see "jaggies"
> if it's not straight. When the dashes are animated, you see these
> jaggies as side-to-side motion of the dashes. The way the line is
> being drawn when it's animated and dashed, the starting offset is
> being stepped. This is moving the jaggies each step.
>
> I *think* that some careful mixing of float and integer math in
>
> Canvas>>line: pt1 to: pt2 width: width color: color1 dashLength: s1
> secondColor: color2 secondDashLength: s2 startingOffset:
> startingOffset
>
> would help. Of course, it might slow it down too.
>
>> There is a visible meandering of the line of plus/minus a pixel or
>> two.
>
> What part meanders? Not the vertices, right?
The end-points are stable, it's just the bits in  between!!

>
> A more serious problem with animated dashes is that it eats up LOTS of
> CPU, especially if you have several animated lines. The lines get
> invalidated and re-drawn constantly. Even worse is when you have
> animated dashed *curved* lines!
>

I've noticed! I had ten open, and the CPU began to crawl as well.

What's the scope for palette animation in Squeak and still stay portable?



More information about the Squeak-dev mailing list