File: geom.go

package info (click to toggle)
golang-github-charmbracelet-x 0.0~git20251028.0cf22f8%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,940 kB
  • sloc: sh: 124; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 396 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package cellbuf

import (
	"image"
)

// Position represents an x, y position.
type Position = image.Point

// Pos is a shorthand for Position{X: x, Y: y}.
func Pos(x, y int) Position {
	return image.Pt(x, y)
}

// Rectangle represents a rectangle.
type Rectangle = image.Rectangle

// Rect is a shorthand for Rectangle.
func Rect(x, y, w, h int) Rectangle {
	return image.Rect(x, y, x+w, y+h)
}