1
0
Fork 0

Merge pull request #5300 from Yash-Ambekar/Yash-Ambekar/issue-#4078

Added documentation of two new methods in the utils section of API.
This commit is contained in:
Joost De Cock 2023-10-28 10:19:52 +02:00 committed by GitHub
commit 28bb38d511
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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](/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](/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)]`