type

Size

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

Size models the width and height of a shape.

constructors

fromStr

Parse from comma or space separated string.

make

Construct with w, h.

makeInt

Construct with w, h as integers.

fields

defVal

Default instance is 0,0.

h

Height

w

Width

methods

equals

Return if obj is same Size value.

hash

Return hash of w and h.

toStr

Return "w h"

Slot Details

defVal

src const static Size defVal := Size.<ctor>(0.0, 0.0)

Default instance is 0,0.

equals

src virtual override Bool equals(Obj? obj)

Return if obj is same Size value.

fromStr

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

Parse from comma or space separated string. If invalid then throw ParseErr or return null based on checked flag.

h

src const Float h

Height

hash

src virtual override Int hash()

Return hash of w and h.

make

src new make(Float w, Float h)

Construct with w, h.

makeInt

src new makeInt(Int w, Int h)

Construct with w, h as integers.

toStr

src virtual override Str toStr()

Return "w h"

w

src const Float w

Width