AttachmentMorph design questions

Ned Konz ned at bike-nomad.com
Sat Sep 30 18:37:02 UTC 2000


Joshua Channing Gargus wrote:

> If you have another morph connected to the rectangle and move
> it in a big circle around the rectangle, you might want the
> connection point to "slide" around the perimeter of the
> rectangle (didn't your earlier changeset do this?  I don't
> have it handy).

Yes, I like that behavior sometimes. My ConnectionMorphs do this
in a very simple way by picking the nearest point (of 8) around the
bounds of the attached Morph.

I was thinking that one
strategy could be for the AttachmentMorph to have a reference
point (perhaps the center of the other attached Morph by default),
and inquire of the attached Morph which connection point to use.
To get behavior like my existing ConnectionMorphs, the reference
point would be the prior line vertex.

> A shortcut for opaque morphs would be to
> attach to each morph's center point, but this would look bad
> for translucent/irregularly-shaped morphs.  I can't think of a
> general way to do this without requiring too much computation,
> though.

I couldn't, either (a general way would be to draw the Morph again
on a private Canvas and search for its edge along a line to the
reference point...).

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list