layout

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCellMargins

func ApplyCellMargins(cell entity.Cell, style *props.Cell) entity.Cell

ApplyCellMargins returns the visible content box inside the allocated cell.

func BumpZerosWithoutOverflow

func BumpZerosWithoutOverflow(sizes []int, _ int) []int

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

func Hamilton(weights []float64, total int) []int

Hamilton distributes total integer units across items proportionally to their weights using the largest-remainder method.

func NormalizeGridSize

func NormalizeGridSize(gridSize int) int

func ProportionalUnits

func ProportionalUnits(weights []float64, total int) []int

func UnitWidth

func UnitWidth(totalWidth float64, unit int, gridSize int) float64

func VerticalCellMargins

func VerticalCellMargins(style *props.Cell) float64

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL