class

Insets

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

Insets represents spacing around the edge of a rectangle.

constructors fromStr

Parse from comma or space separated string using CSS format

make

Construct with top, and optional right, bottom, left

fields top

Top side spacing

left

Left side spacing

bottom

Bottom side spacing

right

Right side spacing

defVal

Default instance 0, 0, 0, 0

methods toStr

If all four sides are equal return "len" otherwise return "top right bottom left"

isNone

Return if all sides are set to zero

equals

Return if obj is same Insets value

w

Left plus right

h

Top plus bottom

toSize

Return right+left, top+bottom

hash

Return hash of top, right, bottom, left

bottom const Float : bottom

Bottom side spacing

defVal const static Insets : defVal

Default instance 0, 0, 0, 0.

equals virtual Bool equals(Obj? obj)

Return if obj is same Insets value.

fromStr static new fromStr(Str s, Bool checked)

Parse from comma or space separated string using CSS format:

  • "top"
  • "top, right" (implies bottom = top, left = right)
  • "top, right, bottom" (implies left = right)
  • "top, right, bottom, left"

h Float h()

Top plus bottom

hash virtual Int hash()

Return hash of top, right, bottom, left.

isNone Bool isNone()

Return if all sides are set to zero

left const Float : left

Left side spacing

make new make(Num top, Num? right, Num? bottom, Num? left)

Construct with top, and optional right, bottom, left. If one side is not specified, it is reflected from the opposite side:

Insets(5)     => Insets(5,5,5,5)
Insets(5,6)   => Insets(5,6,5,6)
Insets(5,6,7) => Insets(5,6,7,6)

right const Float : right

Right side spacing

toSize Size toSize()

Return right+left, top+bottom

toStr virtual Str toStr()

If all four sides are equal return "len" otherwise return "top right bottom left".

top const Float : top

Top side spacing

w Float w()

Left plus right

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST