export function calcEdgeLinesOfRect()

in packages/shared/src/coordinate.ts [343:374]


export function calcEdgeLinesOfRect(rect: IRect): IRectEdgeLines {
  return {
    v: [
      new LineSegment(
        new Point(rect.x, rect.y),
        new Point(rect.x, rect.y + rect.height)
      ),
      new LineSegment(
        new Point(rect.x + rect.width / 2, rect.y),
        new Point(rect.x + rect.width / 2, rect.y + rect.height)
      ),
      new LineSegment(
        new Point(rect.x + rect.width, rect.y),
        new Point(rect.x + rect.width, rect.y + rect.height)
      ),
    ],
    h: [
      new LineSegment(
        new Point(rect.x, rect.y),
        new Point(rect.x + rect.width, rect.y)
      ),
      new LineSegment(
        new Point(rect.x, rect.y + rect.height / 2),
        new Point(rect.x + rect.width, rect.y + rect.height / 2)
      ),
      new LineSegment(
        new Point(rect.x, rect.y + rect.height),
        new Point(rect.x + rect.width, rect.y + rect.height)
      ),
    ],
  }
}