Hierarchy
Properties
Methods
Multiplies the point with the matrix to apply the transformation. Transforming a "point" means also applying any translation from the matrix.
| x'| | a c e | | x | | y'| = | b d f | * | y | | 1 | | 0 0 1 | | 1 |
Parameters
__namedParameters[number, number]Returns
[number, number]
Multiplies the vector with the matrix to apply the transformation. Transforming a "vector" does ignore the translation of the matrix.
| x'| | a c e | | x | | y'| = | b d f | * | y | | 0 | | 0 0 1 | | 0 |
Parameters
__namedParameters[number, number]Returns
[number, number]
Calculates the inverse matrix. This requires the determinant to be != 0, which is always granted since the matrix can only hold affine transformations (all affine transformations are easily invertible).
We exploit the fact that the matrix is affine to speed things up.
Returns
Rotates the matrix by
degdegrees in the xy-plane clockwise about the origin of the Cartesian coordinate system.Parameters
degCWnumberReturns
Rotates the matrix by
radradian in the xy-plane clockwise about the origin of the Cartesian coordinate system.Parameters
anumberReturns
Applies a scaling to the matrix. If only sx is set and sy is undefined, we will scale x and y by sx.
A scale of
1does not modify a dimension.| sx 0 0 |M' = M * | 0 sy 0 | | 0 0 1 |
Parameters
sxnumbersynumberOptionalReturns
Returns the matrix's values as a CSS transform string.
Returns
string
- transform(
a2: number,
b2: number,
c2: number,
d2: number,
e2: number,
f2: number,
): TransformationMatrixMultiplies current matrix values with a new transformation matrix.
The transformation will be applied on the left side of the multiplication, so that they are applied in the order
transform()is called.| a' c' e' | | a2 c2 e2 | | a c e | | b' d' f' | = | b2 d2 f2 | * | b d f | | 0 0 1 | | 0 0 1 | | 0 0 1 |
Parameters
a2numberb2numberc2numberd2numbere2numberf2numberReturns
Applies a translation to the matrix
| 1 0 tx |M' = M * | 0 1 ty | | 0 0 1 |
Parameters
__namedParameters{ x: number; y: number }Returns
Parameters
txnumberReturns
Parameters
tynumberReturns
Immutable Record API
24
asImmutable
- Deprecated
Returns
thisDeprecated
Not part of the collection API the Nutrient Web SDK supports. Build the value once, or use withMutations().
See Also
Map#asImmutable
asMutable
- Deprecated
Returns
thisDeprecated
Not part of the collection API the Nutrient Web SDK supports. Use withMutations().
See Also
Map#asMutable
Returns a new instance of this Record type with all values set to their default values.
Returns
this
Returns a new instance of this Record type with the value for the specific key set to its default value.
Returns a new instance of this Record type with the value at the given key path removed.
Also available as
removeIn.Parameters
keyPathIterable<unknown>Returns
this
Parameters
otherunknownReturns
boolean
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
Parameters
keyPathIterable<unknown>notSetValueunknownOptionalReturns
unknown
Parameters
keyunknownReturns
boolean
mergeIn
removeIn
- Deprecated
Parameters
keyPathIterable<unknown>Returns
thisDeprecated
Not part of the collection API the Nutrient Web SDK supports. Use deleteIn(), or update() followed by delete().
Parameters
keyPathIterable<unknown>valueunknownReturns
this
Deeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
Returns
{ … }
a: number
scaleX()Default Value
1b: number
skewY()Default Value
0c: number
skewX()Default Value
0d: number
scaleY()Default Value
1e: number
translateX()Default Value
0f: number
translateY()Default Value
0
Shallowly converts this Record to equivalent native JavaScript Object.
Returns
{ … }
a: number
scaleX()Default Value
1b: number
skewY()Default Value
0c: number
skewX()Default Value
0d: number
scaleY()Default Value
1e: number
translateX()Default Value
0f: number
translateY()Default Value
0
toSeq
- Deprecated
Returns
Keyed<string, unknown>Deprecated
Not part of the collection API the Nutrient Web SDK supports. Use entries().
Note: Not all methods can be used on a mutable collection or within
withMutations! Onlysetmay be used mutatively.Parameters
mutator(mutable: this) => unknownReturns
thisSee Also
Map#withMutations
Matrix for affine 2D transformations.
Layout:
| a c e | // - (a,b) the x base vector | b d f | // - (c,d) the y base vector | 0 0 1 | // - (e,f) the origin // of the resulting coordinate system.
The third row is always [0 0 1], thus we don't store the values.