@univerjs/engine-render v0.5.0-beta.1 • Docs
Class: Transform
Constructors
new Transform()
new Transform(m): Transform
Parameters
Parameter | Type | Default value |
---|---|---|
m | number [] | INITIAL_MATRIX |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:30
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
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
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:75
clone()
clone(): Transform
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:354
composeMatrix()
composeMatrix(options): Transform
Parameters
Parameter | Type |
---|---|
options | ITransformState |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:335
convert2DOMMatrix2D()
convert2DOMMatrix2D(): {
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
}
Returns
{
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
}
Name | Type | Defined in |
---|---|---|
a | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:396 |
b | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:397 |
c | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:398 |
d | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:399 |
e | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:400 |
f | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:401 |
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:393
copy()
copy(): Transform
Copy universheet.Transform object
Returns
Method
Name
universheet.Transform#copy
Example
const tr = shape.getTransform().copy()
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:55
copyInto()
copyInto(tr): void
Parameters
Parameter | Type |
---|---|
tr | Transform |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:59
decompose()
decompose(): {
angle: 0;
scaleX: 0;
scaleY: 0;
skewX: 0;
skewY: 0;
x: e;
y: f;
}
convert transformation matrix back into node’s attributes
Returns
{
angle: 0;
scaleX: 0;
scaleY: 0;
skewX: 0;
skewY: 0;
x: e;
y: f;
}
Name | Type | Default value | Defined in |
---|---|---|---|
angle | number | 0 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:279 |
scaleX | number | 0 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:280 |
scaleY | number | 0 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:281 |
skewX | number | 0 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:282 |
skewY | number | 0 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:283 |
x | number | e | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:277 |
y | number | f | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:278 |
Method
Name
universheet.Transform#decompose
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:266
getMatrix()
getMatrix(): number[]
return matrix
Returns
number
[]
Method
Name
universheet.Transform#getMatrix
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:228
getMatrixByAccurate()
getMatrixByAccurate(accurate): number[]
return matrix
Parameters
Parameter | Type | Default value |
---|---|---|
accurate | number | 3 |
Returns
number
[]
Method
Name
universheet.Transform#getMatrix
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:237
getTranslation()
getTranslation(): {
x: number;
y: number;
}
Returns the translation
Returns
{
x: number;
y: number;
}
2D point(x, y)
Name | Type | Defined in |
---|---|---|
x | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:149 |
y | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:150 |
Method
Name
universheet.Transform#getTranslation
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:147
invert()
invert(): Transform
Invert the matrix
Returns
Method
Name
universheet.Transform#invert
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:206
makeBoundingBoxFromPoints()
makeBoundingBoxFromPoints(points): IRect
Parameters
Parameter | Type |
---|---|
points | Vector2 [] |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:310
multiply()
multiply(matrix): Transform
Transform multiplication
Parameters
Parameter | Type |
---|---|
matrix | Transform |
Returns
Method
Name
universheet.Transform#multiply
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:181
reset()
reset(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:38
rotate()
rotate(deg): Transform
Apply rotation
Parameters
Parameter | Type |
---|---|
deg | number |
Returns
Method
Name
universheet.Transform#rotate
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:126
scale()
scale(sx, sy): Transform
Apply scale
Parameters
Parameter | Type |
---|---|
sx | number |
sy | number |
Returns
Method
Name
universheet.Transform#scale
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:109
setAbsolutePosition()
setAbsolutePosition(coord): Transform
set to absolute position via translation
Parameters
Parameter | Type |
---|---|
coord | Vector2 |
Returns
Method
Name
universheet.Transform#setAbsolutePosition
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:247
skew()
skew(sx, sy): Transform
Apply skew
Parameters
Parameter | Type |
---|---|
sx | number |
sy | number |
Returns
Method
Name
universheet.Transform#skew
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:162
translate()
translate(x, y): Transform
Apply translation
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Method
Name
universheet.Transform#translate
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:95
create()
static create(m): Transform
Parameters
Parameter | Type | Default value |
---|---|---|
m | number [] | INITIAL_MATRIX |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/basics/transform.ts:34