Monday, July 29, 2013

Morphic Characteristics

In the last week, I made some changes to the Morphic stuff. Here is a list of characteristics of my Morphic implementation.

  • Every Morph has an owner and a list of submorphs.

  • Morphs do not have a position/rotation/scaling anymore, but a transformation matrix. This matrix can translate, rotate, scale, ... the morph. It is possible to translate, rotate and translate the morph again.

  • Morph transformation is relative to its owner's transformation (transformation matrix multiplication).

  • It is not possible to get or set the current position of a morph. A morph can be transformed, relative to its current transformation. In order to set the morph position, we can reset the current transformation matrix (to identity) and translate it.

  • Morphs do not have a width or height. In the drawOn: method, we have to specify an "outerShape". The outer shape should contain all drawings. It is used for point-in-morph tests (mouse events) and as the clipping region. For example, a button's outer shape should be its rectangular border.

  • Submorphs are clipped at the outer shape.

No comments:

Post a Comment