API Reference
@univerjs
@univerjs/engine-render
classes
Transform

@univerjs/engine-render v0.4.2Docs


Class: Transform

Constructors

new Transform()

new Transform(m): Transform

Parameters

ParameterTypeDefault value
mnumber[]INITIAL_MATRIX

Returns

Transform

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:30 (opens in a new tab)

Properties

PropertyTypeDefault valueDefined in
dirtybooleanfalsesubmodules/univer/packages/engine-render/src/basics/transform.ts:26 (opens in a new tab)

Methods

applyPoint()

applyPoint(point, ignoreOffset): Vector2

Transform point

Parameters

ParameterTypeDefault valueDescription
pointVector2undefined2D point(x, y)
ignoreOffsetbooleanfalse-

Returns

Vector2

2D point(x, y)

Method

Name

universheet.Transform#point

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:75 (opens in a new tab)


clone()

clone(): Transform

Returns

Transform

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:354 (opens in a new tab)


composeMatrix()

composeMatrix(options): Transform

Parameters

ParameterType
optionsITransformState

Returns

Transform

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:335 (opens in a new tab)


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;
}
NameTypeDefined in
anumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:396 (opens in a new tab)
bnumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:397 (opens in a new tab)
cnumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:398 (opens in a new tab)
dnumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:399 (opens in a new tab)
enumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:400 (opens in a new tab)
fnumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:401 (opens in a new tab)

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:393 (opens in a new tab)


copy()

copy(): Transform

Copy universheet.Transform object

Returns

Transform

Method

Name

universheet.Transform#copy

Example

const tr = shape.getTransform().copy()

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:55 (opens in a new tab)


copyInto()

copyInto(tr): void

Parameters

ParameterType
trTransform

Returns

void

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:59 (opens in a new tab)


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;
}
NameTypeDefault valueDefined in
anglenumber0submodules/univer/packages/engine-render/src/basics/transform.ts:279 (opens in a new tab)
scaleXnumber0submodules/univer/packages/engine-render/src/basics/transform.ts:280 (opens in a new tab)
scaleYnumber0submodules/univer/packages/engine-render/src/basics/transform.ts:281 (opens in a new tab)
skewXnumber0submodules/univer/packages/engine-render/src/basics/transform.ts:282 (opens in a new tab)
skewYnumber0submodules/univer/packages/engine-render/src/basics/transform.ts:283 (opens in a new tab)
xnumberesubmodules/univer/packages/engine-render/src/basics/transform.ts:277 (opens in a new tab)
ynumberfsubmodules/univer/packages/engine-render/src/basics/transform.ts:278 (opens in a new tab)

Method

Name

universheet.Transform#decompose

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:266 (opens in a new tab)


getMatrix()

getMatrix(): number[]

return matrix

Returns

number[]

Method

Name

universheet.Transform#getMatrix

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:228 (opens in a new tab)


getMatrixByAccurate()

getMatrixByAccurate(accurate): number[]

return matrix

Parameters

ParameterTypeDefault value
accuratenumber3

Returns

number[]

Method

Name

universheet.Transform#getMatrix

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:237 (opens in a new tab)


getTranslation()

getTranslation(): {
  x: number;
  y: number;
}

Returns the translation

Returns

{
  x: number;
  y: number;
}

2D point(x, y)

NameTypeDefined in
xnumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:149 (opens in a new tab)
ynumbersubmodules/univer/packages/engine-render/src/basics/transform.ts:150 (opens in a new tab)

Method

Name

universheet.Transform#getTranslation

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:147 (opens in a new tab)


invert()

invert(): Transform

Invert the matrix

Returns

Transform

Method

Name

universheet.Transform#invert

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:206 (opens in a new tab)


makeBoundingBoxFromPoints()

makeBoundingBoxFromPoints(points): IRect

Parameters

ParameterType
pointsVector2[]

Returns

IRect

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:310 (opens in a new tab)


multiply()

multiply(matrix): Transform

Transform multiplication

Parameters

ParameterType
matrixTransform

Returns

Transform

Method

Name

universheet.Transform#multiply

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:181 (opens in a new tab)


reset()

reset(): void

Returns

void

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:38 (opens in a new tab)


rotate()

rotate(deg): Transform

Apply rotation

Parameters

ParameterType
degnumber

Returns

Transform

Method

Name

universheet.Transform#rotate

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:126 (opens in a new tab)


scale()

scale(sx, sy): Transform

Apply scale

Parameters

ParameterType
sxnumber
synumber

Returns

Transform

Method

Name

universheet.Transform#scale

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:109 (opens in a new tab)


setAbsolutePosition()

setAbsolutePosition(coord): Transform

set to absolute position via translation

Parameters

ParameterType
coordVector2

Returns

Transform

Method

Name

universheet.Transform#setAbsolutePosition

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:247 (opens in a new tab)


skew()

skew(sx, sy): Transform

Apply skew

Parameters

ParameterType
sxnumber
synumber

Returns

Transform

Method

Name

universheet.Transform#skew

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:162 (opens in a new tab)


translate()

translate(x, y): Transform

Apply translation

Parameters

ParameterType
xnumber
ynumber

Returns

Transform

Method

Name

universheet.Transform#translate

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:95 (opens in a new tab)


create()

static create(m): Transform

Parameters

ParameterTypeDefault value
mnumber[]INITIAL_MATRIX

Returns

Transform

Defined in

submodules/univer/packages/engine-render/src/basics/transform.ts:34 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.