The geometry of a layer is defined by two things: its position and its size. Containers may also have an affine transformation (typically only a scale factor) that affects the position and size of sublayers.


The position of a layer is always relative to the geometry of all of the items above it on the layer hierarchy. The view’s position is relative to the window. The container’s position is relative to the view. A sublayer’s position is relative to the container’s position. If sublayer (“Sublayer A”) contains a sublayer (“Sublayer B”), Sublayer B’s position is relative to the position of Sublayer A. And so on.


The container may be locked to the size of the view (as is the case with MerzView) or it may have it’s own size (as is the case with ScrollingMerzView). Sublayers have their own size, which is affected by the container’s sublayer transformation.

Container Sublayer Transformations

A container may have a transformation that is applied to all sublayers of the container. This is defined "sublayerTransformation" property and setSublayerTransformation() method. If only a scale is needed, the "sublayerScale" and setSublayerScale() methods available. Merz automatically manages the value of line widths, text point sizes and other common interface geometry that should not be transformed.

Sublayers may have their own affine transformations, but the resulting behavior is not managed by Merz at this time.