Adding new pre made shape to NKLineEndConstraintMorph

Ned Konz ned at bike-nomad.com
Wed Apr 17 20:40:08 UTC 2002


On Wednesday 17 April 2002 10:06 am, John Hinsley wrote:

> I'm having trouble getting my head round (I'm
> using the openArrowheadShape as a model) exactly what the vertices
> refer to.
>
> The important code (essentially I need to flip the open arrow head)
> seem to be:
>
> ^(PolygonMorph vertices: { 0 at 0 . 6 at 15 . 12 at 0  }
>
> I'd welcome an explanation of what these actually refer to (trying
> to finesse it isn't working out!).

More explanation:

The PolygonMorph there will give you a 6x15 V shape. That's the actual 
end decoration.

Its rotationCenter is a ratio that specifies where that shape rotates 
around (which is where the attachment happens). This can be edited 
using the halos. The heading of the shape should point back in the 
direction where the line will leave the shape.

Its property lineAttachmentOffset (which defaults to 0 at 0) is a 
relative offset for the line to attach to (needed, for instance, by 
the open diamond).

Try drawing these on a piece of graph paper to get the feel for it.

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




More information about the Squeak-dev mailing list