size

package
v0.0.0-...-8b68c8a Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: GPL-3.0 Imports: 2 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dif

func Dif[T Width | Height](l, r T) T

Dif returns positive difference between to same T values

Types

type Height

type Height uint

Height - vertical size

const HeightZero Height = 0

HeightZero - default value of Height

func AppendHeight

func AppendHeight(h Height, v int) Height

AppendHeight adds int value safely

func MakeHeight

func MakeHeight[T constraints.Integer](v T) Height

MakeHeight constructs Height object

func (Height) Index

func (h Height) Index() index.Index

Index converts Height to Index

func (Height) Int

func (h Height) Int() int

Int converts Height to int

type Width

type Width uint

Width - horizontal size

const (
	// WidthZero - default size
	WidthZero Width = 0

	// WidthSpace - space between base columns size
	WidthSpace Width = 1

	// WidthColumn - base column size (fib3)
	WidthColumn Width = 3

	// WidthTab - tab size
	WidthTab = WidthColumn + WidthSpace

	// WidthDescriptionColumnShift - min rune len of title for pasting break line
	WidthDescriptionColumnShift = 2*WidthColumn + 2*WidthSpace
)

func MakeWidth

func MakeWidth[T constraints.Integer](v T) Width

MakeWidth constructs Width object

func (Width) Int

func (w Width) Int() int

Int converts Width to int

Jump to

Keyboard shortcuts

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