Debian Codegraph @

cellbuf/geom.go

raw
1 package cellbuf
2
3 import (
4 "image"
5 )
6
7 // Position represents an x, y position.
8 type Position = image.Point
9
10 // Pos is a shorthand for Position{X: x, Y: y}.
11 func Pos(x, y int) Position {
12 return image.Pt(x, y)
13 }
14
15 // Rectangle represents a rectangle.
16 type Rectangle = image.Rectangle
17
18 // Rect is a shorthand for Rectangle.
19 func Rect(x, y, w, h int) Rectangle {
20 return image.Rect(x, y, x+w, y+h)
21 }