const class dom::Pos

sys::Obj
  dom::Pos

@Js
@Serializable { simple=true }

Source

Pos represents a coordinate.

defVal

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

Source

Default instance is 0, 0.

equals

virtual override Bool equals(Obj? obj)

Source

Return if obj is same Pos 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.

hash

virtual override Int hash()

Source

Return hash of x and y.

make

new make(Int x, Int y)

Source

Construct with x, y.

rel

Pos rel(Elem e)

Source

Assuming a page position, return position relative to the given Elem.

toStr

virtual override Str toStr()

Source

Return "x,y"

translate

Pos translate(Int tx, Int ty)

Source

Return x+tx, y+ty

translatePos

Pos translatePos(Pos t)

Source

Return x+tx, y+ty

x

const Int x

Source

X coordinate

y

const Int y

Source

Y coordinate