SvgTransformOrder interface
An order of applySvgTransforms, created by svgRotateBy, svgRotateTo, svgFlipTo, svgScaleBy, svgTranslateBy or svgPlaceOn: keep it to change its values later with set.
ts
import type { SvgTransformOrder } from 'utils';Signature
ts
export interface SvgTransformOrder<TArguments extends unknown[]> {
/** Changes the values of the order; once applied, its own transform is updated. */
set(...args: TArguments): void;Parameters
| Name | Description |
|---|---|
TArguments | The values of the order, the same as the arguments of its function. |
Tests
Line coverage: 0 %.
Source
src/svg-transform/svg-transform-order.ts (on GitHub)
Used by
applySvgTransforms: Applies orders to an SVG element, in order, each on what the previous ones give: one transform per order is added at the end of itstransformlist.svgFlipTo: An order ofapplySvgTransformsthat makes the element mirrored or not, as seen on screen, around one of its anchors:svgFlipTo(false)makes a mirrored text readable again.svgPlaceOn: An order ofapplySvgTransformsthat moves the element so that one of its anchors lands on an anchor of another element, as seen on screen, whatever groups each one is in.svgRotateBy: An order ofapplySvgTransformsthat turns the element by an angle from its position before this order, clockwise on screen, around an anchor of itself or of another element:set(90)afterset(3)gives 90° from the start, not 93°.svgRotateTo: An order ofapplySvgTransformsthat turns the element to an absolute angle on screen, clockwise from upright, around an anchor of itself or of another element:svgRotateTo(0)straightens it.svgScaleBy: An order ofapplySvgTransformsthat enlarges or shrinks the element in its own axes, around an anchor of its drawing, which gives the direction: with'left', it grows to the right; with'bottom', upwards.svgTranslateBy: An order ofapplySvgTransformsthat moves the element along its own axes, in its own units: turned by 90°, "to the right" goes down on screen.
Source code
ts
/**
* An order of `applySvgTransforms`, created by `svgRotateBy`, `svgRotateTo`, `svgFlipTo`, `svgScaleBy`,
* `svgTranslateBy` or `svgPlaceOn`: keep it to change its values later with `set`.
*
* @template TArguments - The values of the order, the same as the arguments of its function.
*/
export interface SvgTransformOrder<TArguments extends unknown[]> {
/** Changes the values of the order; once applied, its own transform is updated. */
set(...args: TArguments): void;
}Keywords: svg, transform, order, svg transforms, interface