Mantis - Squeak
Viewing Issue Advanced Details
2127 Morphic text always 10-25-05 21:53 02-24-06 21:31
closed 3.9  
none 3.9  
0002127: Enhanced comment for the PolygonMorph
When I started with Squeak (some time ago), PolygonMorph puzzled me. The proposed comment is an attempt to clarify basic things.

For example, I was able to create new polygon-morph. I've got a triangle. But couldn't find a way how to add new vertices.

The "Additional Information" contains the full text of the new version of the PolygonMorph's class comment.
This class implements a morph which can behave as four different objects depending on the the following two facts:
- is it OPEN or CLOSED?

1. The OPEN and SEGMENTED variant looks like polyline.

2. The OPEN and SMOOTHED variant looks like spline (kind of curve)

3. The CLOSED and SEGMENTED variant looks like polygon. This is actually what you get when you do
    PolygonMorph new openInWorld
You get a triangle. See below how to manipulate these objects...

4. The CLOSED and SMOOTHED variant looks like blob (???)

Prototypes of this morph can also be found in "Object Catalog". Several (different variants) of this object are among "Basic" morphs.

Explore the assiciated morph-menu. It enables you
- to toggle showing of "handles". They make it possible to
    - reposition already existing vertices (by moving yellow handles)
    - create new vertices (by moving green handles)
    - delete already existing vertices (by dragging and dropping one yellow handle closely
      nearby the adjacent yellow handle
  Handles can be made visible/hidden by shift+leftclicking the morph. This way it is possible
  to quickly show handles, adjust vertices and then again hide handles.
- making closed polygon open, i.e. converting it to a curve (and vice versa)
- toggle smoothed/segmented line/outline
- set up custom dashing (for line, curves or borders of closed polygons
- set up custom arrow-heads (for lines resp. curves)
Implementation notes:

The 1-bit fillForm to make display and containment tests reasonably fast. However, this functionality is in the process of being supplanted by balloon capabilities, which should eventually provide anti-aliasing as well.
 PolygonMorph-enh.2.cs [^] (1,933 bytes) 10-25-05 21:53

02-24-06 21:31   
in 7003