Documentation
¶
Index ¶
- func ApplyCellMargins(cell entity.Cell, style *props.Cell) entity.Cell
- func BumpZerosWithoutOverflow(sizes []int, _ int) []int
- func DefaultGridSize() int
- func Hamilton(weights []float64, total int) []int
- func NormalizeGridSize(gridSize int) int
- func ProportionalUnits(weights []float64, total int) []int
- func UnitWidth(totalWidth float64, unit int, gridSize int) float64
- func VerticalCellMargins(style *props.Cell) float64
- type ManualPlan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyCellMargins ¶
ApplyCellMargins returns the visible content box inside the allocated cell.
func BumpZerosWithoutOverflow ¶
BumpZerosWithoutOverflow ensures every zero size becomes at least 1 when a larger sibling can donate a unit, preserving the original sum.
func DefaultGridSize ¶
func DefaultGridSize() int
func Hamilton ¶
Hamilton distributes total integer units across items proportionally to their weights using the largest-remainder method.
func NormalizeGridSize ¶
func ProportionalUnits ¶
func VerticalCellMargins ¶
Types ¶
type ManualPlan ¶
type ManualPlan struct {
Units []int
GridSize int
TotalUnits int
Slack int
Overflow int
InvalidIndices []int
}
func ManualUnits ¶
func ManualUnits(units []int, gridSize int) ManualPlan
Click to show internal directories.
Click to hide internal directories.