const class gfx::Rect

sys::Obj
  gfx::Rect

@Js
@Serializable { simple=true }

Source

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

contains

Bool contains(Int x, Int y)

Source

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

defVal

const static Rect defVal := Rect.<ctor>(0, 0, 0, 0)

Source

Default instance is 0, 0, 0, 0.

equals

virtual override Bool equals(Obj? obj)

Source

Return if obj is same Rect value.

fromStr

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

Source

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

h

const Int h

Source

Height

hash

virtual override Int hash()

Source

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

intersection

Rect intersection(Rect that)

Source

Compute the intersection between this rectangle and that rectangle. If there is no intersection, then return defVal.

intersects

Bool intersects(Rect that)

Source

Return true if this rectangle intersects any portion of that rectangle

make

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

Source

Construct with x, y, w, h.

makePosSize

new makePosSize(Point p, Size s)

Source

Construct from a Point and Size instance

pos

Point pos()

Source

Get the x, y coordinate of this rectangle.

size

Size size()

Source

Get the w, h size of this rectangle.

toStr

virtual override Str toStr()

Source

Return "x,y,w,h"

union

Rect union(Rect that)

Source

Compute the union between this rectangle and that rectangle, which is the bounding box that exactly contains both rectangles.

w

const Int w

Source

Width

x

const Int x

Source

X coordinate

y

const Int y

Source

Y coordinate