2023-05-07 08:37:03 -07:00
|
|
|
---
|
|
|
|
title: Stack.generateTransform()
|
|
|
|
---
|
|
|
|
|
2023-05-26 18:42:20 -07:00
|
|
|
The `Stack.generateTransform()` method generates SVG transforms for the stack,
|
2023-05-07 08:37:03 -07:00
|
|
|
sets them as attributes, and returns the original stack.
|
|
|
|
|
|
|
|
|
|
|
|
## Stack.generateTransform() signature
|
|
|
|
|
|
|
|
```js
|
|
|
|
Stack stack.generateTransforms(Object transforms)
|
|
|
|
```
|
|
|
|
|
|
|
|
The `Stack.generateTransforms()` method takes a single argument,
|
|
|
|
an object with the following properties containing the transforms
|
|
|
|
to apply:
|
|
|
|
|
|
|
|
| Property | Type |Description |
|
|
|
|
|----------|------|------------|
|
|
|
|
| `move` | Object | `move.x` and `move.y` are coordinates to which the stack should be translated
|
|
|
|
| `rotate` | Number | The number of degrees to rate the stack around its center |
|
|
|
|
| `flipX` | Boolean | Whether to flip the stack along the X axis |
|
|
|
|
| `flipY` | Boolean | Whether to flip the stack along the Y axis |
|
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::noteThis method is chainable as it returns the Stack object:::
|