- Index
- »
- fan.graphics
- »
- Insets
Insets
@Js
@Serializable { simple=true }
const class Insets : Obj
Insets represents spacing around the edge of a rectangle.
Parse from comma or space separated string using CSS format
Construct with top, and optional right, bottom, left
Top side spacing
Left side spacing
Bottom side spacing
Right side spacing
Default instance 0, 0, 0, 0
If all four sides are equal return "len" otherwise return "top right bottom left"
Return if all sides are set to zero
Return if obj is same Insets value
Left plus right
Top plus bottom
Return right+left, top+bottom
Return hash of top, right, bottom, left
const Float : bottom
Bottom side spacing
const static Insets : defVal
Default instance 0, 0, 0, 0.
virtual Bool equals(Obj? obj)
Return if obj is same Insets value.
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"
Float h()
Top plus bottom
virtual Int hash()
Return hash of top, right, bottom, left.
Bool isNone()
Return if all sides are set to zero
const Float : left
Left side spacing
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)
const Float : right
Right side spacing
Size toSize()
Return right+left, top+bottom
virtual Str toStr()
If all four sides are equal return "len" otherwise return "top right bottom left".
const Float : top
Top side spacing
Float w()
Left plus right