Fantom

 

const class

gfx::Rect

sys::Obj
  gfx::Rect

@Js
@Serializable { simple=true collection=false }

Represents the x,y coordinate and w,h size of a rectangle.

Slots

containsSource

Bool contains(Int x, Int y)

Return true if x,y is inside the bounds of this rectangle.

defValSource

const static Rect defVal := Rect(0, 0, 0, 0)

Default instance is 0, 0, 0, 0.

equalsSource

override Bool equals(Obj? obj)

Overrides sys::Obj.equals

Return if obj is same Rect value.

fromStrSource

static Rect? fromStr(Str s, Bool checked := true)

Parse from string. If invalid and checked is true then throw ParseErr otherwise return null.

hSource

const Int h

Height

hashSource

override Int hash()

Overrides sys::Obj.hash

Return hash of x, y, w, and h.

makeSource

new make(Int x, Int y, Int w, Int h)

Construct with x, y, w, h.

makePosSizeSource

new makePosSize(Point p, Size s)

Construct from a Point and Size instance

posSource

Point pos()

Get the x, y coordinate of this rectangle.

sizeSource

Size size()

Get the w, h size of this rectangle.

toStrSource

override Str toStr()

Overrides sys::Obj.toStr

Return "x,y,w,h"

wSource

const Int w

Width

xSource

const Int x

X coordinate

ySource

const Int y

Y coordinate