1
0
Fork 0

added documentation to two new methods in the utils section of API

This commit is contained in:
Yash-Ambekar 2023-10-27 23:58:35 +05:30
parent 8a8074da86
commit 7ed4d4e249
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,18 @@
---
title: utils.applyTransformToPoint()
---
The `utils.applyTransformToPoint()` function applies a specified transformation to the point's coordinates. Returns the transformed point as a [Point](https://freesewing.dev/reference/api/point) object.
## Signature
```js
Point utils.applyTransformToPoint(string transform, Point A)
```
## Parameters
1st parameter is a SVG transform string. Eg: `scale(sfx, sfy)` where `sfx` and `sfy` are the scaling factors along the x-axis and y-axis respectively.
2nd parameter is the original point that is to be transformed. It is a [Point](https://freesewing.dev/reference/api/point) object.

View file

@ -0,0 +1,16 @@
---
title: utils.combineTransform()
---
The `utils.combineTransform()` function merges an array of SVG transformations into a single composite matrix transformation. Returns a single combined matrix transform string.
## Signature
```js
string utils.combineTransforms(string[] transforms)
```
## Parameters
The function only takes a single parameter i.e array of transform strings. Eg: `["scale(sfx, sfy)", rotate(angle), translate(tx, ty)]`