Discover Packages
github.com/kode4food/toe
internal
geom
package
Version:
v0.1.21
Opens a new window with list of versions in this module.
Published: Jul 30, 2026
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Area is a screen rectangle: an origin Point and a Size
Bottom is the y of the bottommost cell (inclusive): Y + Height - 1
Center returns the origin Point that centers inner within a, clamped so the
origin never precedes a's own origin when inner is larger
Contains reports whether a Point lies inside the specified Area
Inset returns a shrunk toward its center by by.Width on the left and right
and by.Height on the top and bottom, with the Size clamped to zero
Intersects reports whether a and b overlap in at least one cell
Right is the x of the rightmost cell (inclusive): X + Width - 1
Translate returns a copy of Area with its origin shifted by Point
type Point struct {
X, Y int
}
Point is a screen or document coordinate in cells
Add returns p offset by d
Sub returns p offset by the negation of d
type Size struct {
Width, Height int
}
Size is a pixel or cell extent, named so a call site never has to guess
the order a bare (int, int) would leave ambiguous
Clamp returns p pinned to the last valid cell of the Size, i.e. into the
range [0, Width-1] x [0, Height-1]
Contains reports whether a Point lies inside the specified Size
Empty reports whether Size has no usable cells
Source Files
¶
Click to show internal directories.
Click to hide internal directories.