# author: Ethosa
import vector2
{.used.}


type
  AnchorObj* = object
    x1*, y1*, x2*, y2*: float
  AnchorRef* = ref AnchorObj


proc Anchor*(x1, y1, x2, y2: float): AnchorRef {.inline.} =
  AnchorRef(x1: x1, y1: y1, x2: x2, y2: y2)

proc Anchor*(vec1, vec2: Vector2Ref): AnchorRef {.inline.} =
  AnchorRef(x1: vec1.x, y1: vec1.y, x2: vec2.x, y2: vec2.y)

func isEmpty*(a: AnchorRef): bool {.inline.} =
  a.x1 == 0 and a.x2 == 0 and a.y1 == 0 and a.y2 == 0
