@univerjs/engine-render v0.5.4
Class: Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:25
Constructors
new Transform()
new Transform(m): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:30
Parameters
Parameter | Type | Default value |
---|---|---|
m | number [] | INITIAL_MATRIX |
Returns
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
dirty | boolean | false | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:26 |
Methods
applyPoint()
applyPoint(point, ignoreOffset): Vector2
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:75
Transform point
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
point | Vector2 | undefined | 2D point(x, y) |
ignoreOffset | boolean | false | - |
Returns
2D point(x, y)
Method
Name
universheet.Transform#point
clone()
clone(): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:354
Returns
composeMatrix()
composeMatrix(options): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:335
Parameters
Parameter | Type |
---|---|
options | ITransformState |
Returns
convert2DOMMatrix2D()
convert2DOMMatrix2D(): {
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
}
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:393
Returns
{
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
}
copy()
copy(): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:55
Copy universheet.Transform object
Returns
Method
Name
universheet.Transform#copy
Example
const tr = shape.getTransform().copy()
copyInto()
copyInto(tr): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:59
Parameters
Parameter | Type |
---|---|
tr | Transform |
Returns
void
decompose()
decompose(): {
angle: number;
scaleX: number;
scaleY: number;
skewX: number;
skewY: number;
x: number;
y: number;
}
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:266
convert transformation matrix back into node’s attributes
Returns
{
angle: number;
scaleX: number;
scaleY: number;
skewX: number;
skewY: number;
x: number;
y: number;
}
Method
Name
universheet.Transform#decompose
getMatrix()
getMatrix(): number[]
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:228
return matrix
Returns
number
[]
Method
Name
universheet.Transform#getMatrix
getMatrixByAccurate()
getMatrixByAccurate(accurate): number[]
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:237
return matrix
Parameters
Parameter | Type | Default value |
---|---|---|
accurate | number | 3 |
Returns
number
[]
Method
Name
universheet.Transform#getMatrix
getTranslation()
getTranslation(): {
x: number;
y: number;
}
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:147
Returns the translation
Returns
{
x: number;
y: number;
}
2D point(x, y)
Method
Name
universheet.Transform#getTranslation
invert()
invert(): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:206
Invert the matrix
Returns
Method
Name
universheet.Transform#invert
makeBoundingBoxFromPoints()
makeBoundingBoxFromPoints(points): IRect
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:310
Parameters
Parameter | Type |
---|---|
points | Vector2 [] |
Returns
multiply()
multiply(matrix): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:181
Transform multiplication
Parameters
Parameter | Type |
---|---|
matrix | Transform |
Returns
Method
Name
universheet.Transform#multiply
reset()
reset(): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:38
Returns
void
rotate()
rotate(deg): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:126
Apply rotation
Parameters
Parameter | Type |
---|---|
deg | number |
Returns
Method
Name
universheet.Transform#rotate
scale()
scale(sx, sy): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:109
Apply scale
Parameters
Parameter | Type |
---|---|
sx | number |
sy | number |
Returns
Method
Name
universheet.Transform#scale
setAbsolutePosition()
setAbsolutePosition(coord): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:247
set to absolute position via translation
Parameters
Parameter | Type |
---|---|
coord | Vector2 |
Returns
Method
Name
universheet.Transform#setAbsolutePosition
skew()
skew(sx, sy): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:162
Apply skew
Parameters
Parameter | Type |
---|---|
sx | number |
sy | number |
Returns
Method
Name
universheet.Transform#skew
translate()
translate(x, y): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:95
Apply translation
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Method
Name
universheet.Transform#translate
create()
static create(m): Transform
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:34
Parameters
Parameter | Type | Default value |
---|---|---|
m | number [] | INITIAL_MATRIX |