package
Version:
v0.0.0-...-0f375d1
Opens a new window with list of versions in this module.
Published: Jun 21, 2021
License: Unlicense
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
cell provides basic cell geometries.
type Pt struct {
L int
O int
}
Pt is a line oriented cell position.
Add moves a point to direction of q.
Compare compares two Pt a and b.
If a < b, it will return -1.
If a > b, it will return 1.
If a == b, it will return 0
Add moves a point to opposite direction of q.
type Range struct {
Start Pt
End Pt
}
Range is a range between two points which excludes max.
Start is not necessarily before than End.
For that purpose, use MinMax.
Contains checks whether it contain's p.
Lines returns line numbers the Range includes, as int slice.
Note it will not return last line number if Max's offset is 0.
Max returns the Ranges's maximum position.
Min returns the Range's minimum position.
MinMax return the Range's caculated Min and Max points.
type Rect struct {
Start Pt
End Pt
}
Rect is a rectangle area which exculdes Max.
Start is not necessarily before than End.
For that purpose, use MinMax.
Max returns the Rect's bottom right position.
Min returns the Rect's top left position.
MinMax returns the Rect's caculated Min and Max positions.
Size returns size of the Rect as a point.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.