Graphite: move, scale or rotate a layer
graphite_transform_layerTransform existing Graphite layers in parent coordinates using translation, scaling, rotation, or an SVG matrix; combine with or replace the current transform in one undo step.
Instructions
Apply a transform to an existing layer, in its parent's coordinate space (document pixels for top-level layers). Give translate, scale and/or rotate (applied as scale, then rotate about origin, then translate), or a raw SVG matrix [a, b, c, d, e, f]. By default the transform is combined with the layer's current one; replace=true sets it outright. One undo step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Uniform factor or [sx, sy]. | |
| matrix | No | Raw affine matrix; overrides translate/scale/rotate. | |
| origin | No | Pivot [x, y] for scale and rotate; default [0, 0]. | |
| rotate | No | Degrees, clockwise (y grows downward). | |
| replace | No | true sets the layer's transform to exactly this matrix instead of combining. | |
| layer_id | Yes | layer_id as returned by graphite_insert_svg or listed by graphite_get_document. | |
| translate | No | [dx, dy] in pixels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| matrix | Yes | ||
| replace | Yes | ||
| layer_id | Yes |