Skip to content

Shape transformations

SprocketNYC edited this page Jul 21, 2014 · 3 revisions

The following attributes of IPrimitive nodes (i.e. Groups and Shapes) affect the shape and size of a node: x, y, rotation, scale, shear, and offset.

We apply the attributes in the following order:

  1. x, y - moves the node within the parent context.
  2. rotation - rotates the node around its (x,y) origin.
  3. offset - (dx, dy) if the shape has a rotation, rotate about this distance from the shape origin.
  4. scale - scales the node about the (x,y) position. Different scale factors can be provided for the X and Y directions. Negative scale factors can be used to mirror (a.k.a reflect) a node.
  5. shear - shears the node about the (x,y) position. Different shear factors can be provided for the X and Y directions.
Transform Basic Node Attributes Shape Specific Attributes

Viewport Transform

The Transform of the Viewport determines which Nodes (on "transformable" Layers) are visible and at what scale. The zoom Mediators and pan Mediators all modify the Viewport's transform attribute.

To receive event notifications when a Viewport's transform attribute changes, register a ViewportTransformChangedHandler. See Mediators for more info.

Clone this wiki locally