From 7ed4d4e249f687fc76b3e76e0e92be2ea52bf10f Mon Sep 17 00:00:00 2001 From: Yash-Ambekar Date: Fri, 27 Oct 2023 23:58:35 +0530 Subject: [PATCH 1/2] added documentation to two new methods in the utils section of API --- .../api/utils/applytransformtopoint/en.md | 18 ++++++++++++++++++ .../api/utils/combinetransforms/en.md | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 markdown/dev/reference/api/utils/applytransformtopoint/en.md create mode 100644 markdown/dev/reference/api/utils/combinetransforms/en.md diff --git a/markdown/dev/reference/api/utils/applytransformtopoint/en.md b/markdown/dev/reference/api/utils/applytransformtopoint/en.md new file mode 100644 index 00000000000..b718bef97c0 --- /dev/null +++ b/markdown/dev/reference/api/utils/applytransformtopoint/en.md @@ -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. + diff --git a/markdown/dev/reference/api/utils/combinetransforms/en.md b/markdown/dev/reference/api/utils/combinetransforms/en.md new file mode 100644 index 00000000000..7e099b85d72 --- /dev/null +++ b/markdown/dev/reference/api/utils/combinetransforms/en.md @@ -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)]` + From 9545062cab8ed91581d83c6aa21199d43aa4bc47 Mon Sep 17 00:00:00 2001 From: Yash-Ambekar Date: Sat, 28 Oct 2023 13:34:40 +0530 Subject: [PATCH 2/2] replaced the url to Point object to relative path --- markdown/dev/reference/api/utils/applytransformtopoint/en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown/dev/reference/api/utils/applytransformtopoint/en.md b/markdown/dev/reference/api/utils/applytransformtopoint/en.md index b718bef97c0..215291d2495 100644 --- a/markdown/dev/reference/api/utils/applytransformtopoint/en.md +++ b/markdown/dev/reference/api/utils/applytransformtopoint/en.md @@ -2,7 +2,7 @@ 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. +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 @@ -14,5 +14,5 @@ Point utils.applyTransformToPoint(string transform, Point A) 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. +2nd parameter is the original point that is to be transformed. It is a [Point](/reference/api/point) object.