[Q] slow animated dashed lines/connectors

Ned Konz ned at bike-nomad.com
Sat Apr 19 16:55:55 UTC 2003


On Saturday 19 April 2003 09:36 am, Martin Drautzburg wrote:
> Ned Konz <ned at bike-nomad.com> writes:
> > Some questions:
>
> 1 GHz Athlon, the Squeak UI is usually very responsive. The lines
> are straight linel.
>
> > I believe, though, that you're right about repeated redrawing
> > (this isn't a Connectors problem as such
>
> I only put the word "connectors" in the subject because (1) it
> really is a connector and (2) to attract your attention.
>
> > I guess the reason I never tried to do anything about this is
> > that I find more than about one animated dashed line to be
> > visually annoying.
>
> In this particular case the animation visualizes a "Mail Flow"
> (postal automation). It looks very intuitive. There can be many
> mailflows though.
>
> In any case:
>
> I got several interesting responses to this question and other
> speed related issues pointing to "caching Morphs in a Form". I
> could not figure out how to do this. I found a Class CachingMorph,
> but it seems to unused in Squeak itself.
>
> Can you give me a good starting point ?

I don't think this is going to be easy for the case of the 
PolygonMorph.

What you'd have to do is to make a Form the size of the full bounds of 
the Connector; then when you draw it you'd have to provide a mask to 
draw through (as the Connector doesn't fill the entire rectangle). Or 
you could break up drawing but then you'd have to make sure that you 
could tile your form and mask.

I suspect that this would be more work and memory than just letting 
the PolygonMorphs redraw.

But the simplest way to do this kind of thing in general is to use a 
FormCanvas and tell your Morph to draw on the FormCanvas. This 
renders to a real Form that can then be used to draw with later.

If you had lots of really identical Morphs that were animated, Bert's 
suggestion would make sense. However, I'm guessing that the 
individual lines aren't identical.

The pallette animation idea is interesting, though.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list