-
Notifications
You must be signed in to change notification settings - Fork 59
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:
- x, y - moves the node within the parent context.
- rotation - rotates the node around its (x,y) origin.
- offset - (dx, dy) if the shape has a rotation, rotate about this distance from the shape origin.
- 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.
- shear - shears the node about the (x,y) position. Different shear factors can be provided for the X and Y directions.
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.