type

Size

@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

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

Default instance is 0,0.

equals

virtual override Bool equals(Obj? obj)

Return if obj is same Size value.

fromStr

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

const Float h

Height

hash

virtual override Int hash()

Return hash of w and h.

make

new make(Float w, Float h)

Construct with w, h.

makeInt

new makeInt(Int w, Int h)

Construct with w, h as integers.

toStr

virtual override Str toStr()

Return "w h"

w

const Float w

Width