type

Transform

src @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

src const Float a

b

src const Float b

c

src const Float c

d

src const Float d

defVal

src const static Transform defVal := ...

Default instance is no transform.

e

src const Float e

equals

src virtual override Bool equals(Obj? obj)

Equality is based on string format

f

src const Float f

fromStr

src 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

src virtual override Int hash()

Hash code is based on string format

make

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

Construct from matrix values

mult

src @Operator
This mult(Transform that)

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

rotate

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

Rotate angle in degrees

scale

src static Transform scale(Float sx, Float sy)

Scale transform

skewX

src static Transform skewX(Float angle)

Skew x by angle in degrees

skewY

src static Transform skewY(Float angle)

Skew y by angle in degrees

toStr

src virtual override Str toStr()

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

translate

src static Transform translate(Float tx, Float ty)

Translate transform