type

Transform

@Js
@Serializable { simple=true }
const class Transform : Obj

Transform models an affine transformation matrix:

|a  c  e|
|b  d  f|
|0  0  1|

constructors

fromStr

Parse from SVG string format

make

Construct from matrix values

fields

a
b
c
d
defVal

Default instance is no transform.

e
f

methods

equals

Equality is based on string format

hash

Hash code is based on string format

mult

Multiply this matrix by given matrix and return result as new instance

rotate

Rotate angle in degrees

scale

Scale transform

skewX

Skew x by angle in degrees

skewY

Skew y by angle in degrees

toStr

Return in matrix(<a> <b> <c> <d> <e> <f>) format

translate

Translate transform

Slot Details

a

const Float a

b

const Float b

c

const Float c

d

const Float d

defVal

const static Transform defVal := ...

Default instance is no transform.

e

const Float e

equals

virtual override Bool equals(Obj? obj)

Equality is based on string format

f

const Float f

fromStr

static new fromStr(Str s, Bool checked := true)

Parse from SVG string format:

matrix(<a> <b> <c> <d> <e> <f>)
translate(<x> [<y>])
scale(<x> [<y>])
rotate(<a> [<x> <y>])
skewX(<a>)
skewY(<a>)

hash

virtual override Int hash()

Hash code is based on string format

make

new make(Float a, Float b, Float c, Float d, Float e, Float f)

Construct from matrix values

mult

@Operator
This mult(Transform that)

Multiply this matrix by given matrix and return result as new instance

rotate

static Transform rotate(Float angle, Float? cx := null, Float? cy := null)

Rotate angle in degrees

scale

static Transform scale(Float sx, Float sy)

Scale transform

skewX

static Transform skewX(Float angle)

Skew x by angle in degrees

skewY

static Transform skewY(Float angle)

Skew y by angle in degrees

toStr

virtual override Str toStr()

Return in matrix(<a> <b> <c> <d> <e> <f>) format

translate

static Transform translate(Float tx, Float ty)

Translate transform